Array find Method | JavaScript Tutorial | Usage and Implementation step by step guide

preview_player
Показать описание
In this video I talk about one of the most popular Array methods in JavaScript - find.

0:00 - Intro
0:20 - How to use find method
3:19 - Implementing your own find method
Рекомендации по теме
Комментарии
Автор

Very nice, but your version of find has a very important mistake: if (result === true) should be if (result).
You'll notice the difference if run such code: [0, 1, 2].find(x => x) returns 1 when myFind([0, 1, 2], x => x) will be undefined.
Also you never mentioned other arguments of criteria function - it was out of this video scope, but it would be nice to make a hint, that thetre is more.

QwDragon