Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

how to create a json array in javascript code example

Example 1: 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 
    });
}

Example 2: json arrays

{
  "array": [{1,2,3,4,5,6}]
}

Tags:

Javascript Example

Related

convolutional neural network convolution layers or just final one code example extract value after character t sql code example git abort head merge with conflicts code example linux login password code example javascript timestamp to date format code example forgenKey sql code example nodejs trace logging open source code example factorial injs code example mongoose compare objectid code example python activate environment code example example jest test typescript class with array declaration code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy