DEVFYI - Developer Resource - FYI

eval()?

JavaScript Interview Questions and Answers


(Continued from previous question...)

108. eval()?

The eval() method is incredibly powerful allowing you to execute snippets of code during exection.

<script type="text/javascript">
var USA_Texas_Austin = "521,289";
document.write("Population is "+eval("USA_"+"Texas_"+"Austin"));
</script>
This produces
Population is 521,289

(Continued on next question...)

Other Interview Questions