Тёмный

The Smartest Way to Search Arrays in JavaScript 

dcode
Подписаться 135 тыс.
Просмотров 4,5 тыс.
50% 1

In today's video, we have a look at different ways to search arrays in JavaScript - things such as includes(), find() and findIndex() can be used to do this 😎
For your reference, check this out:
developer.mozi...
🏫 My Udemy Courses - www.udemy.com/...
🎨 Download my VS Code theme - marketplace.vi...
💜 Join my Discord Server - / discord
🐦 Find me on Twitter - / dcodeyt
💸 Support me on Patreon - / dcode
📰 Follow me on DEV Community - dev.to/dcodeyt
📹 Join this channel to get access to perks - / @dcode-software
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
#dcode #javascript

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@Sayvai
@Sayvai Год назад
Great video 😎 Already personally familiar with all those approaches. There is also an alternate version of searching an array and returning a boolean to indicate whether an even number exists in this example, using the Array.prototype.some() function. The Array.prototype.some() function will traverse through the array until the expression evaluates to find a match and returns true, or false if the expression doesn't ever evaluate / match, thereby returning false. Powerful, yet can be performant, as it can break out of an array iteration on first match, without traversing through the whole array. See an example snippet below: ``` const numbers = [5, 9, 2, 4, 3]; const containsEvenNumber = numbers.some(n => n % 2 === 0); console.log(containsEvenNumber); // true ```
@UsernameUsername0000
@UsernameUsername0000 11 месяцев назад
Great video. Array.prototype.some would’ve been perfect to introduce after the Array.prototype.find example, since it is similar but returns the Boolean like wanted.
@raphaeljaggerd3585
@raphaeljaggerd3585 Год назад
So many ways to skin the poverbial cat. Thanks for the great content. By any chance are you willing to do tutorials on making packages
@lounes03b99
@lounes03b99 Год назад
hi! i finished js course since days ago... I don't know what should do to practice? Solve some Problems In Problem Solving Websites Or start directly build project with HTML, CSS and JS? would you please make a video show how to build a begginer/intermediate website and landing page 🙏 🙏 with Front-End Basics🙏 🙏 Thank You ♥ ♥
@farazk9729
@farazk9729 11 месяцев назад
Hi Domenic, Thanks for your very helpful videos; I am going through them one by one. I was wondering if you also have videos on React. I did a quick search, but I didn't find any. Thanks, Faraz
@lounes03b99
@lounes03b99 Год назад
You're gorgeous 🔥 I liks Your Videos 📹 Keep going🏃
Далее
5 Real Life Examples of Array Reduce in JavaScript
12:47
#kikakim
00:10
Просмотров 14 млн
Лучше одной, чем с такими
00:54
У КОТЯТ ОТКРЫЛИСЬ ГЛАЗКИ#cat
00:26
JavaScript Higher Order Functions & Arrays
34:56
Просмотров 986 тыс.
I Waited 15 Years For These New Array Methods
8:11
Просмотров 222 тыс.
JavaScript Array Mastery: Tips, Tricks & Best Practices
1:02:49
JavaScript Search Bar
14:57
Просмотров 169 тыс.
Easy Ways to Loop Over Objects in JavaScript
11:21
Просмотров 10 тыс.
Formatting Is So Easy With The Intl JavaScript API
10:21
#kikakim
00:10
Просмотров 14 млн