Skip to content

Instantly share code, notes, and snippets.

@VenkataRaju
Created August 5, 2015 08:42
Show Gist options
  • Save VenkataRaju/5a9e6698cbcb41730ae8 to your computer and use it in GitHub Desktop.
Save VenkataRaju/5a9e6698cbcb41730ae8 to your computer and use it in GitHub Desktop.
Basic Nashorn Script
if (typeof $ARG === "undefined" || $ARG.length !== 2)
print("Usage: jjs -scripting --language=es6 test.js -- arg1 arg2");
else
doSomething.apply(null, $ARG);
function doSomething(first, second)
{
print("first: " + first + ", second: " + second);
for (let i = 0; i < 2; i++)
print(i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment