Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

lodash get first element of array

require('lodash').first(array);
require('lodash').first([1, 3, 9]);
console.log(require('lodash').first([8, 2, 9]);
console.log(require('lodash').first([5, 3, 10]);

// Output
8
5
 
PREVIOUS NEXT
Tagged: #lodash #element #array
ADD COMMENT
Topic
Name
2+1 =