DEV Community

Discussion on: Supercharge Your Skills: 7 Tips for Writing Clean and Efficient JavaScript

Collapse
 
bcostaaa01 profile image
Bruno

In my point of view, you’ve missed a lot of topics in efficient and clear JavaScript…

Some other topics would include:

  • declaring variables on top of their scope, which makes it easy to see where each variable is in the current scope.
  • using strict mode.
  • using let and const instead of var. It helps avoiding a lot of errors and you can have more control over the scope of variables.
  • using arrow functions as much as possible, except on very specific cases where you can only achieve your goal with a regular function.

And this is only part of a long list of best practices for clean and efficient JavaScript code. It is not only about commenting - which in my opinion, should instead be that the code is self-explanatory, or at least as much as possible -, but also about these aspects and tools that you can make use of in order to make your JavaScript code better to read and function. As for the title of your post, I wouldn’t call it “supercharge” when it comes to skills, this is more about best practices.

Collapse
 
mohsenkamrani profile image
Sam

Thanks for your good addition. Really didn't wan to make the post longer than it is.