“массив JS” Ответ

Создайте массив с номером JS

var foo = new Array(45); // create an empty array with length 45
Bad Booby

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]);
}
Grepper

JavaScript Array Read Значение объекта в массиве

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);
Dead Dingo

массив JS

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

//can add an element to array like this:
colors.push("blue");

//loop through an array like this:
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Vast Vendace

массив JS

const person = { firstName: "John" lastName:"Lee" age: "11"}
const fruits = [
  {id: 1, name: 'Apple'},
  {id: 2, name: 'Banana'},
  {id: 3, name: 'Orange'},
]
Insert_Name_Here

массив JS

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

console.log(fruits.length)
// 2
Inquisitive Iguana

Ответы похожие на “массив JS”

Вопросы похожие на “массив JS”

Больше похожих ответов на “массив JS” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования