Array Every Method in JavaScript - CodeMorsels

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Using a ‘for’ or ‘while’ loop will generally execute faster in JavaScript than using an Array.prototype.every() method. This is mainly because the ‘every’ method has additional function call overhead for each element in the array, whereas a simple loop is just a straightforward iteration with condition checking. It does take up fewer lines of code though, so as long as you are aware of what ‘every’ does, it’s neater looking.

CoLD.SToRAGE