Is This the Most Useful JavaScript Method?

  Рет қаралды 1,224

dcode

dcode

28 күн бұрын

Methods such as map(), filter(), every() & reduce() are useful, but which one would you choose if you couldn't use one of the other 3 again? Let's find out.
For your reference, check this out:
developer.mozilla.org/en-US/d...
🏫 My Udemy Courses - www.udemy.com/user/domenic-co...
🎨 Download my VS Code theme - marketplace.visualstudio.com/...
💜 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

Пікірлер: 15
@EricEGunes
@EricEGunes 27 күн бұрын
Absolutely!!! Reduce() ! You can do same jobs if you know how to! - but the performance results for processing an array of 100,000 elements: • map() took approximately 0.044 seconds • reduce() took approximately 19.010 seconds
@beratyilmaz7951
@beratyilmaz7951 27 күн бұрын
not true, write your code so we can test it
@raven.4815
@raven.4815 27 күн бұрын
A whooping 19 secs? That's absolute madness
@alexanderkomanov4151
@alexanderkomanov4151 25 күн бұрын
Nice one! Thanks!
@marshallgraphic
@marshallgraphic 27 күн бұрын
I don't think result && ... will reassign the value to result, or am I mistaking the prev result is the value of the previous return value?
@mimosveta
@mimosveta 26 күн бұрын
it will
@dcode-software
@dcode-software 26 күн бұрын
Yeah it works because once it reaches the first element that gives "false", the value can't ever evaluate to "true" ever again because we use &&
@mimosveta
@mimosveta 26 күн бұрын
I knew of it for few years, and basically never used it, but I think I will start now... I guess I'll first use it to translate other methods to reduce, just to get used to it...
@dcode-software
@dcode-software 26 күн бұрын
Yeah sure, but of course, I'm not suggesting you replace "map" with "reduce". If the method exists for the purpose then definitely use it. This video is more for education
@usagiakimbo2506
@usagiakimbo2506 27 күн бұрын
Good examples, thanks for this
@dcode-software
@dcode-software 26 күн бұрын
All good 👍
@bmehder
@bmehder 27 күн бұрын
reduce() is the god method
@dcode-software
@dcode-software 26 күн бұрын
💪
@suelingsusu1339
@suelingsusu1339 27 күн бұрын
Beautiful.... 👌👌👌👌👌👏👏👏👏🙏🙏🙏🙏🌹🌹🌹🌹🌹🖖🖖🖖🖖🖖🖖
@dcode-software
@dcode-software 26 күн бұрын
Many many thanks
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 184 М.
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 229 М.
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 47 МЛН
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 48 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 287 М.
Top 50 Most Asked JavaScript Logical Interview Questions || Must Watch🤯😱
1:09:02
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,6 МЛН
If this ships, it will change javascript forever
25:54
Theo - t3․gg
Рет қаралды 199 М.
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 169 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 347 М.
Learn Closures In 13 Minutes
13:22
Web Dev Simplified
Рет қаралды 58 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 234 М.
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН