Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check if all array values are the same

const allEqual = arr => arr.every( v => v === arr[0] )
allEqual( [1,1,1,1] )  // true
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #check #array #values
ADD COMMENT
Topic
Name
1+5 =