Published in


Clean Code in JavaScript — Part 1

17 clean code tips (JavaScript) that every developer should know!!

  • Function should always do single task. That makes unit testing super easy for you.
  • In case you are unable to reduce the number of parameters then pass all the arguments as an object and use destructing syntax in function.
  • If it returns a value/function
  • Doesn’t mutate the state of input or any global variable
  • For same input, same output

Final Thoughts

In this article, I discuss how we can write clean code by following simple rules. But it's not always possible to practice all rules, as each team, has it’s own standard.

  1. Clean Code in JavaScript: Develop reliable, maintainable, and robust JavaScript by James Padolsey
  2. Clean Code by Robert Martin



Technical blogs, Mini project idea, Coding and updates about new technology

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store