Array.prototype.everybeginnerconst words = ['hello', 'world']
words.every(w => w.length > 3) // β true
words.every(w => w.startsWith('h')) // β falseUse every() to validate that all strings in an array meet a specific criterion.
every() can test any condition on any element type. Testing string length is a common use case for input validation.
Challenge: Implement allNonEmpty(strs) that returns true if every string in the array has a length greater than 0.
allNonEmpty(['hello', 'world']) // β true
allNonEmpty(['hello', '']) // β false