Answers for "how to initialize an array in javascript"

0

initialize javascript array variable

var arrayName = new Array();
var arrayName = new Array(Number length);
var arrayName = new Array(element1, element2, element3);
Posted by: Guest on January-20-2021
5

javascript array read object value in array

var events = [
  {
    userId: 1,
    place: "Wormholes Allow Information to Escape Black Holes",
    name: "Check out this recent discovery about workholes",
    date: "2020-06-26T17:58:57.776Z",
    id: 1
  },
  {
    userId: 1,
    place: "Wormholes Allow Information to Escape Black Holes",
    name: "Check out this recent discovery about workholes",
    date: "2020-06-26T17:58:57.776Z",
    id: 2
  },
  {
    userId: 1,
    place: "Wormholes Allow Information to Escape Black Holes",
    name: "Check out this recent discovery about workholes",
    date: "2020-06-26T17:58:57.776Z",
    id: 3
  }
];
console.log(events[0].place);
Posted by: Guest on July-18-2020
0

how to initialize an array in javascript

var array_name = [item1, item2, ...];
Posted by: Guest on June-29-2020

Code answers related to "how to initialize an array in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language