Courses / JavaScript
59. Array.prototype.every()
Tests whether all elements in the array pass the test implemented by the provided function.
JavaScript
Array.prototype.every()
Array.prototype.every() checks if all elements in an array pass a given test.
"I want to make sure every item in my list meets certain criteria without writing a loop."
Array.prototype.every() executes a callback function on each element of an array and returns true only if all elements pass the test. If any element fails, it returns false immediately.
"I want to make sure every item in my list meets certain criteria without writing a loop."
Array.prototype.every() executes a callback function on each element of an array and returns true only if all elements pass the test. If any element fails, it returns false immediately.