Code should be written in such a way that is self-explanatory, easy to understand, and easy to modify or extend for the new features. Don't turn naming into a riddle game. Use default arguments instead of short-circuiting or conditionals. The smaller the function the better it is to understand and refactor.

6m read timeFrom apoorvtyagi.tech
Post cover image
Table of contents
0. Naming1. Conditionals2. Functions should do one thing3. Use default arguments4. Single Level of Abstraction(SLA)5. Don't ignore caught errors8. Import only what you need9. Keep Function arguments 3 or less (ideally)10. Use array spreads to copy arrays.11. Write linear code12. Use ESLint and Prettier13. Use proper parentheses14. Return early from functionsConclusion
11 Comments

Sort: