check every value in array javascript

Solutions on MaxInterview for check every value in array javascript by the best coders in the world

showing results for - "check every value in array javascript"
Angela
20 Feb 2020
1["foo", "foo", "foo"].every((item, index) => item === "foo") // returns true since every item matches our condition
2["foo", "bar", "foo"].every((item, index) => item === "foo") // return false because not all items match our condtion