what is eval pls breif information send me

Answer Posted / negi

The eval() function evaluates a string and executes it as if
it was script code.

In this example we use eval() on some strings and see what
it returns:

<script type="text/javascript">

eval("x=10;y=20;document.write(x*y)");
document.write("<br />");

document.write(eval("2+2"));
document.write("<br />");

var x=10;
document.write(eval(x+17));
document.write("<br />");

</script>

The output of the code above will be:

200
4
27

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is javascript? List some data types supported by javascript?

522


What is a closure in javascript?

582


Difference between undefined and undeclared variables?

517


How do you declare in javascript?

466


Name some of the Javascript frameworks?

555






What is viewstate in javascript?

553


Is it possible make a call to server side event of any button using javascript?

539


What is the concept of “functions as objects” and how does this affect variable scope?

483


What is context in javascript?

491


Is javascript open source?

452


What's the date object using javascript?

555


What are the decodeURI() and encodeURI()?

596


What is event in web programming?

482


what will happen and why if i will acess the methods of superclass which is declared as private by a object of same subclass.

1578


What coding language should I learn first?

484