7 MUST KNOW JavaScript Tips and Tricks

preview_player
Показать описание
JavaScript is a beautiful language and has many ways you can speed up your development time or simplify code. In this video I'll take you through some techniques to do just that 🙂 enjoy!

Chapters:
0:00 1. Destructuring with Parameters
1:05 2. Deep Copy with JSON
2:25 3. Easy Defaults with OR
3:55 4. Advanced Array Searching
5:38 5. Remove Array Duplicates
6:45 6. Self-Invoking Functions
8:01 7. Array Copying with Spread

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
Рекомендации по теме
Комментарии
Автор

1:06 why don't you just use structuredClone()? Why are you abusing JSON.parse(JSON.stringify()) here?

BenjaminAster
Автор

Thanks for these tricks, have a great day!

edwinroman
Автор

Object destructiring is the best thing since sliced bread. Love a bit of `let { prop1, prop2 } = obj`

robwatson
Автор

Null coalescing instead of `||`

The self-invoking functions are called IIFEs I think

re.liable
Автор

It is also possible to use the new Set trick with spreading as in const noDuplicates = [...new Set(duplicates)];

Marcieur
Автор

3:18 Use ??, not || here because if the value is zero, false or an empty string you wouldn't want it to fall back to the default.

BenjaminAster
Автор

0:05 just use a real function () {} (not an arrow function) here, then you can use the "this" keyword. So you can just say this.className.

BenjaminAster
Автор

hello sir, your udemy link is not working

mohammedabdulaziz
Автор

What makes the first example a "must know?" It's interesting but doesn't seem very practical, seems like de-structuring for it's own sake. Much easier and more common to use the (e) instead.

MrBrady
Автор

turn to javascript frameworks like react and node js

goljivines