Тёмный
No video :(

JavaScript Array every method 

Steve Griffith - Prof3ssorSt3v3
Подписаться 102 тыс.
Просмотров 13 тыс.
50% 1

How to use the JavaScript Array every method to test and see if EVERY element in an Array passes the same test.
You could use this to test numeric values, string lengths, or even pattern matches like whether or not everything in the array was a valid email address. The method works when the function returns true for every item in the array.
Code Gist: gist.github.co...
MDN reference: developer.mozi...
Array some method video: • JavaScript Array some ...

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

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@rotrose7531
@rotrose7531 4 года назад
I am happy to imagine who I will become after finishing all your tutorials.
@KL4NNNN
@KL4NNNN 4 года назад
Man if you apply to work on a radio station you would make tons of money as everyone would listen to your voice
@zharrfk4721
@zharrfk4721 4 года назад
How if i do make a function but no parameter ? Does it work? I confused, very confused Please explain For example Function a () { var localMe; return localMe < 10; } Parameter is local variable and function body is local variable I confuse
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
The function, whether it is anonymous or declared will always be passed the three values in the same order. myArray.every( function(item, index, arr){ }); //or function f(item, index, arr){ } myArray.every( f );
@zharrfk4721
@zharrfk4721 4 года назад
@@SteveGriffith-Prof3ssorSt3v3 ooh, i see, thanks so much your explanation, thanks
@yunusmile
@yunusmile 3 года назад
1.33 even the dog had enough of these complicated stuff
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
:P
@blyfo
@blyfo 6 лет назад
Great video dude! Short, sharp and to the point!
@NicoHeinrich
@NicoHeinrich 3 года назад
Thumbs up for this voice!
@chesterxp508
@chesterxp508 3 года назад
Brilliant tutorials :)
@slugmanestudios768
@slugmanestudios768 4 года назад
what a voice
@frownless
@frownless 4 года назад
Awesome explanation thank you
@frownless
@frownless 4 года назад
i have a question so i tried using your explanation but when i try printing every single item i get only the first value like this ------------------------------------------ function palindrome(str) { let result = str.split('') result.every((val) =>{ console.log(val) }) } palindrome('abba')
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
The every method looks for a truthy or falsey value to come back from the function. As soon as it gets a falsey value it stops. Your function has no explicit return value, so it returns undefined which is falsey. console.log( ) returns undefined which is falsey. So, even the arrow function without the curly braces would still stop on the first iteration if all you put there was the console.log. Here is a version that shows all the letters. function palindrome2(str) { let result = str.split(''); result.every((val) =>{ console.log(val); return true; }) } palindrome2('abba');
@husainahmmed9025
@husainahmmed9025 6 лет назад
Thanks
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 6 лет назад
You're welcome!
@joeyng1282
@joeyng1282 4 года назад
'cool
@milankbudha
@milankbudha 3 года назад
plz use mic....your voice is so low even at full volume
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
The videos that I made 3 years ago were with a cheap mic so the audio on some of them is quite low. However, headphones with noise cancelling type technology will also reduce the volume. I have two different sets of headphones and the audio level is very different on both.
@juwoncaleb
@juwoncaleb 3 года назад
CAN YOU SPEAK UP ??? URGH
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
The videos that I made 3 years ago were just with the built-in mic. Some of them have lower audio quality. Everything in the last 2.5 years has much better audio quality.
Далее
JavaScript Array some method
6:39
Просмотров 12 тыс.
JavaScript Array filter method
9:15
Просмотров 18 тыс.
when you have plan B 😂
00:11
Просмотров 10 млн
Сказала дочке НЕТ!
00:24
Просмотров 514 тыс.
Manipulating and Sorting Arrays in JavaScript
12:32
Просмотров 21 тыс.
Deep Dive into Array from method
22:05
Просмотров 2,7 тыс.
JavaScript Array concat method
4:14
Просмотров 12 тыс.
JavaScript Problem: Sorting an Array of Objects
9:25
All 33 JavaScript Array Methods In One Video
51:11
Просмотров 30 тыс.
Premature Optimization
12:39
Просмотров 802 тыс.
JavaScript Array Every Method Practice in 5 Minutes
6:13
when you have plan B 😂
00:11
Просмотров 10 млн