Answers for "how to select the first item in an array"

2

javascript select first n elements from array

const array = ['toto','tata','titi','tutu'];

array.slice(0, 2); // => ['toto','tata']
Posted by: Guest on March-08-2021
4

javascript get first element of array

let array = [1,2,3] // makes your array
array[0] // returns first element of your array.
Posted by: Guest on June-16-2020

Code answers related to "how to select the first item in an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language