cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

ES6 syntax error: 'operator is only available in ES6 (use 'esversion: 6')'

lala_guliyeva
10-Marble

ES6 syntax error: 'operator is only available in ES6 (use 'esversion: 6')'

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

4 REPLIES 4

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

Top Tags