mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 04:56:23 +00:00
686 B
686 B
id | title |
---|---|
e7ed8c3a-ee07-4d46-ace9-f354ee4a47b2 | JavaScript Arrays |
Syntax
let listOfNumbers = [2, 3, 5, 7, 11];
console.log(listOfNumbers[2]); // 5
console.log(listOfNumbers[0]); // 2
Type
In JavaScript arrays are a type of object that
store sequences of things. typeof
wil therefore return "object"
let listOfThings = ["Car", "Mr Magoo", 42];
console.log(typeof listOfThings); // object