Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check every value in array javascript

["foo", "foo", "foo"].every((item, index) => item === "foo") // returns true since every item matches our condition
["foo", "bar", "foo"].every((item, index) => item === "foo") // return false because not all items match our condtion
 
PREVIOUS NEXT
Tagged: #check #array #javascript
ADD COMMENT
Topic
Name
9+2 =