Clean Code: Functions (Part 2) - Beau teaches JavaScript

preview_player
Показать описание
Learn the best practices of how to create Clean Code in JS. This video tutorial is part 2 of how easy is to write Javascript functions that are readable, reusable, and refactorable. Special thanks to Ryan McDermott for a lot of the code in this video.

Code:
Ryan McDermott’s original article:

⭐JavaScript Playlists⭐

-
We're busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Рекомендации по теме
Комментарии
Автор

Just to be clear, when replacing conditional with polymorphism, a conditional might still be needed, just not inside the class.
Somewhere, someone or something needs to decide which subclass should be instantiated

mudshark
Автор

3:20 with the "for" loop, the complexity is just O(n), with the ".map" and the ".reduce" will be 2O(n), not the best in case of high data volume

lucagambaro
Автор

I think for 3:50 there is a shorter sollution: const totalOutput = programmerOutput.reduce((acc, elem) => acc + elem.linesOfCode, 0)

ievgengolskov
Автор

Man.... im not going to use Inheritance. This makes the code reeeealy messy logically. But the videos are great!

rafaelrocha
Автор

For the first function example, you forgot to give it an argument, what could be confusing for someone.

redelectro
Автор

aren't there cases where conditionals are just more convenient and gives you better performance?

briankoo
welcome to shbcf.ru