Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hello,
My platform version is ThingWorx 8.5.4-b222
In service I try to use spread operator:
const result = [...arr1, ...arr2];
But I receive error:
'spread operator' is only avaiable in ES6 (use 'esversion: 6')
How can I fix it?
Thanks in advance.
Solved! Go to Solution.
Hi,
I don't think spread operator is supported, Thingworx 8.5.x is using Rhino Javascript Engine 1.7.11.
See here a support table:
https://mozilla.github.io/rhino/compat/engines.html
Hope it helps,
Raluca Edu
Hi,
Could you provide a code example to reproduce it?
Thanks,
Raluca Edu
hi,
yes, sure:
const arr1 = [0, 1, 2];
const arr2 = [3, 4, 5];
let result = [...arr1, ...arr2];
Hi,
I don't think spread operator is supported, Thingworx 8.5.x is using Rhino Javascript Engine 1.7.11.
See here a support table:
https://mozilla.github.io/rhino/compat/engines.html
Hope it helps,
Raluca Edu
Hi @lala_guliyeva.
If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon