Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript take first element of array

const array = [1,2,3,4,5];
const firstElement = array.shift();

// array -> [2,3,4,5]
// firstElement -> 1
 
PREVIOUS NEXT
Tagged: #javascript #element #array
ADD COMMENT
Topic
Name
7+8 =