10 Common JavaScript Clean Code Mistakes

preview_player
Показать описание
We all want to write better code so we can advance in our careers and show our colleagues how good we are. But that's tough when your code smells.

In this video, I'm going to show you 10 common JavaScript code smells and how you can avoid these making these mistakes.

1. Stuffing lots of logic inside a single function
2. Mutating objects & arrays instead of using the spread operator
3. Using await where a promise isn't returned
4. Over-complicated parameter list
5. Un-used or commented code
6. Pointless comments
7. Pointless conditions
8. Apply DRY within a service
9. Bad tests
10. Not enforcing these rules

🌎 Follow me here:
Рекомендации по теме
Комментарии
Автор

Thanks so much, your TypeScript series are awesome. I´m learning TypeScript

diegocardona
Автор

simple and to the point, thank you :)

a_maxed_out_handle_of__chars
Автор

Overuse of spread operator it also bad smell. Code becomes a dice game. (:, …, :, ?)Sometimes concat method is more readable and you can pass both single object or array. Also if you need to use reduce for 10000 elements. It will create 10000 arrays of 10000 elements. If you have requirements for performance this will make rewrite all the spread shht

artemmakatera