what is eval pls breif information send me



what is eval pls breif information send me..

Answer / 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

More JavaScript Interview Questions

What is stack queue?

0 Answers  


Can I declare a variable as CONSTANT in JavaScript?

0 Answers  


What is isnan in javascript?

0 Answers  


How to create arrays in javascript?

0 Answers  


If you need to hide the javascript code from the older browser versions, how will you perform it?

0 Answers  






What is the data type of variables in javascript?

0 Answers  


How to create an array in javascript?

0 Answers  


What is encodeuri() in javascript?

0 Answers  


What is the method for reading and writing a file in javascript?

0 Answers  


What is push() method in javascript?

0 Answers  


What is the main difference between Map collections and other collections such as Set.

0 Answers  


what is pop()method in JavaScript?

0 Answers  


Categories