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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

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)

 

 

Top Tags