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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

How to merge two objects in Thingworx?

Sathishkumar_C
17-Peridot

How to merge two objects in Thingworx?

We are trying to merge two objects as follows, 

 

const object1 = {
  name: 'Flavio'
}
const object2 = {
  age: 35
}
result = {...object1, ...object2 }

 

We are getting syntax error with Thingworx. 

 

How can we do with Thingworx?

ACCEPTED SOLUTION

Accepted Solutions

You can use Object.assign.

 

For your specific example:

 

result = Object.assign({}, object1, object2)

 

 

View solution in original post

1 REPLY 1

You can use Object.assign.

 

For your specific example:

 

result = Object.assign({}, object1, object2)

 

 

Announcements


Top Tags