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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! 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?

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