Created
January 18, 2019 21:49
-
-
Save eleinadani/bede50929c23557fd530d4137c4f22ca to your computer and use it in GitHub Desktop.
This file contains 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
// Create the JS runtime (aka, "Context") | |
Context cx = Context.create("js"); | |
Value json = cx.eval("js", "(function(x,y) { return JSON.stringify({x:x,y:y}); })"); | |
// Use the function | |
json.execute(42,43).asString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment