Arrays are similar to Python lists in terms of declaration.
let fruits = ["apple", "banana", "orange"];
let numbers = [1, 2, 3, 4];Arrays are quite different from Python in terms of the names of their available methods. There are around 20 methods for arrays, however add them below one-by-one as you learn them. As usual, the methods are accessed using dot operator as such arr.push(5)
-
push- adds an element at the end of the array (append) -
pop- removes the last element
Array.length - is a property that returns the size of array. No brackets.