Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js create json array

var employees = {
    accounting: []
};

for(var i in someData) {    

    var item = someData[i];   

    employees.accounting.push({ 
        "firstName" : item.firstName,
        "lastName"  : item.lastName,
        "age"       : item.age 
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #create #json #array
ADD COMMENT
Topic
Name
5+9 =