Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
how to store data on json in array
Posted
Comments
Maarten Kools 22-Feb-14 5:16am    
I'm not sure what you mean. Do you want to deserialize JSON into an array?
Mohammad Nawaz 22-Feb-14 6:45am    
yes

1 solution

C#
var employees = {
    accounting: []
};

for(var i in someData) {

    var item = someData[i];

    employees.accounting.push({
        "firstName" : item.firstName,
        "lastName"  : item.lastName,
        "age"       : item.age
    });
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900