forin loop syntax error
SwanX1 opened this issue ยท 1 comments
Not sure if this is a KubeJS error, or a Rhino error, but running the following code (or something similar) doesn't work:
let testobject = {
a: 'bc',
foo: 'bar'
};
for (const key in testobject) {
console.log(key);
}
throws a syntax error on line 5, however if the const
is replaced with var
, it works fine.
Not supported by Rhino https://mozilla.github.io/rhino/compat/engines.html#ES2015-bindings-const-for-in-loop-iteration-scope (see this page for various compat issues)