jjs 可以调用js nashorn engine
位置:jdk1.8.0_271
jjs --language=es5 -strict=true 注意options
jjs --language=es6
在es5下,使用es6语法中的let,报错
jjs --language=es5 -strict=true test.js
test.js
var array1 = new Array();
array1[0] = 'aaa';
array1[1] = 'bbb';
array1[2] = 'ccc';
var temp = array1.shift();
print(temp);let str1 = 'abc123';
print(str1);
分别使用es5 es6 运行脚本
参考:
.html#GUID-AB5FB8B1-AEE4-4ECE-9ECE-06E1A66F0291
.html
/
/
本文发布于:2024-01-29 11:48:03,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170650008815057.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |