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

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?

1 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