- Joined
- Jan 20, 2009
- Messages
- 21,122
- Likes received
- 773
- Thanks received
- 222
- Location
- Clown World
How can I create an empty typed JSON object in javascript?
For example
Creates me a JSON object with two items in the array "users".
What if I wanted users to be strongly typed, but empty? Then add items using the push method?
Any ideas?
For example
Code:
var data={"users":[
{
"firstName":"Ray",
"lastName":"Villalobos",
"joined":2012
},
{
"firstName":"John",
"lastName":"Jones",
"joined":2010
}
]}
Creates me a JSON object with two items in the array "users".
What if I wanted users to be strongly typed, but empty? Then add items using the push method?
Any ideas?