Answers for "array in js"

138

javascript array

//create an array like so:
var colors = ["red","blue","green"];

//you can loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Posted by: Guest on July-01-2019
0

javascript array

window.location.href
Posted by: Guest on December-12-2020
6

array in javascript

var a=[];
Posted by: Guest on October-26-2020
14

how to create an array in javascript

let fruits = ['Apple', 'Banana']

console.log(fruits.length)
// 2
Posted by: Guest on June-25-2020
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
-1

array in js

var array_name = [item1, item2, ...];      
//Used to store more than 1 items
Posted by: Guest on October-14-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language