xxxxxxxxxx
let arr = new Array(element0, element1, , elementN)
let arr = Array(element0, element1, , elementN)
let arr = [element0, element1, , elementN]
xxxxxxxxxx
Array.from({length: 10}, (_, i) => i + 1)
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
xxxxxxxxxx
let fruits = ['Apple', 'Banana']
console.log(fruits.length)
// 2
xxxxxxxxxx
var array = [item1, item2, ..];
/*
item1 and item2 could be a string (which is
a letter written in double or single quotes like this "string" or 'string') or
a number (which is just a normal number on the keypad) or a boolean (which is
an experssion which either returns to true of false) and the ..... means that
the inputs can be infinite.
*/
xxxxxxxxxx
// Ways to create an array in javascript
const stuff = [element1, element2, ]; // array literal notation
const stuff = new Array(element1, element2, ); // array object notation