Is This the Most Useful JavaScript Method?

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

dcode

dcode

18 күн бұрын

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 16 күн бұрын
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 16 күн бұрын
not true, write your code so we can test it
@raven.4815
@raven.4815 16 күн бұрын
A whooping 19 secs? That's absolute madness
@alexanderkomanov4151
@alexanderkomanov4151 15 күн бұрын
Nice one! Thanks!
@marshallgraphic
@marshallgraphic 16 күн бұрын
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 15 күн бұрын
it will
@dcode-software
@dcode-software 15 күн бұрын
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 15 күн бұрын
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 15 күн бұрын
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 16 күн бұрын
Good examples, thanks for this
@dcode-software
@dcode-software 15 күн бұрын
All good 👍
@bmehder
@bmehder 16 күн бұрын
reduce() is the god method
@dcode-software
@dcode-software 15 күн бұрын
💪
@suelingsusu1339
@suelingsusu1339 16 күн бұрын
Beautiful.... 👌👌👌👌👌👏👏👏👏🙏🙏🙏🙏🌹🌹🌹🌹🌹🖖🖖🖖🖖🖖🖖
@dcode-software
@dcode-software 15 күн бұрын
Many many thanks
I Built My Own Date Formatter With JavaScript
16:02
dcode
Рет қаралды 941
5 Ways to Create Arrays in JavaScript
11:43
dcode
Рет қаралды 1,1 М.
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 190 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 59 МЛН
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 7 МЛН
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 168 М.
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 482 М.
TypeScript Generics are EASY once you know this
22:21
ByteGrad
Рет қаралды 129 М.
Modern Python logging
21:32
mCoding
Рет қаралды 164 М.
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
Рет қаралды 197 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 341 М.
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 180 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 223 М.