javascript index up to code example
Example 1: access index of array javascript
let first = fruits[0]
// Apple
let last = fruits[fruits.length - 1]
// Banana
Example 2: js index to index
let array = [5, "Foo", 3, "Bar"];
array.slice(2);
// Output = [3, "Bar"]
let string = "Volvo Cars";
string.slice(2);
// Output = "lvo cars"