Created
June 2, 2015 13:11
-
-
Save droxer/04b2ec98b60cdaa154e6 to your computer and use it in GitHub Desktop.
javascript eval example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/node | |
| var assert = require('assert') | |
| function foo () { | |
| return "foobar"; | |
| } | |
| eval("var bar = " + foo.toString()) | |
| assert.equal(foo(), bar()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment