Answers for "how to select first index of 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

Code answers related to "how to select first index of array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language