Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript select first n elements from array

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

array.slice(0, 2); // => ['toto','tata']
 
PREVIOUS NEXT
Tagged: #javascript #select #elements #array
ADD COMMENT
Topic
Name
4+9 =