Adding property to object with node.js

Viewed 33

Im trying to add a property to a JSON object in NODE.

Im doing as I do with angular:

 APIresponse.membershipData.dependents[i].age=age;

But it is not working, its just not adding the property.

Is the syntax different in Node?

Thanks.

1 Answers

Try

APIresponse.membershipData.dependents[i]["age"]=age;
Related