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
What is slug in javascript?
How do I write script-generated content to another window?
accessdenied javanet disconnet
What is difference == and === in javascript?
How to disable an html object ?
What are the javascript data types?
What is a javascript code?
What is a frontend framework?
What is variable typing?
java pgm for compare two vesion and print the greatest version on the console. e.g: like 1.4.2 and 1.5.2 biggest is 1.5.2 1.2.5 and 1.2.8 biggest is 1.2.8
Difference between window.onload and onDocumentReady?
What is the difference between the operators ‘==‘ & ‘===‘?
What is use of object as function?
hi iM rahul.my questions is my project is a web based & developed using java,jsp. when i record it using qtp what script i will get like either browser("jdfjkf").page("nkf").... or javawindow("f d ").javaedit("Dasf").... plz clarify my doubt asap and i also need some vbscipt of java coding?
How do you sort an array in javascript?