In 2024, use scriptArgs
because arguments
doesn’t work:
$ js --version
JavaScript-C128.4.0
$ cat script.js
print(arguments);
$ js script.js hello world
script.js:1:7 ReferenceError: arguments is not defined
Stack:
@script.js:1:7
$ cat script.js
print(scriptArgs);
$ js script.js hello world
hello,world