How do i add new attribute (element) to JSON object using javascript
3
1
|
|||||
|
9
|
JSON stands for JavaScript Object Notation. A JSON object is really a string that has yet to be turned into the object it represents. To add a property to an existing object in JS you could do the following.
or
If you provide some extra info like exactly what you need to do in context you might get a more tailored answer. |
||
|
2
|
A JSON object is simply a javascript object, so with Javascript being a prototype based language, all you have to do is address it using the dot notation.
|
||
|
-5
|
Thank you. It worked. |
||||
|