---
title: "Discussion on \"10 best JavaScript practices recommended by Top Developers\" | Hashnode"
description: "Discussion on \"10 best JavaScript practices recommended by Top Developers\". If you have recently started learning JavaScript or a beginner I would highly recommend you to read the complete article so that you follow better practises while coding in JavaScript as it's a little different. \n\nIt's been a few months since I have ..."
url: "https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [10 best JavaScript practices recommended by Top Developers](https://blog.hrithwik.dev/10-best-javascript-practices-recommended-by-top-developers?utm_source=hashnode&utm_medium=feed)

If you have recently started learning JavaScript or a beginner I would highly recommend you to read the complete article so that you follow better practises while coding in JavaScript as it's a little different. It's been a few months since I have ...

Nov 17, 2020 · 12 min read · blog.hrithwik.dev  
Updated Feb 17, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#programming](https://hashnode.com/tag/programming)
-   [#hashnodecommunity](https://hashnode.com/tag/hashnodecommunity)
-   [#best-practices](https://hashnode.com/tag/best-practices)

## Written by

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

@hrithwik · Bangalore, India

  
[View profile](https://hashnode.com/@hrithwik)

Software Engineer ,Tech Enthusiast, Violinist

I am a full stack developer from Mysore India. I am here to share as much information I know with the world in the most articulate way.

## Responses 15

Markdown supported · ⌘↵ to post

[Caleb](https://hashnode.com/@caleb153)

[Nov 24, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fbc802bec43af1ba6093cab)

Nice article! 👏

Btw just adding to the `~~x` tip, bitwise operators only work with 32-bit numbers, so if you have a number that could be greater than 2147483647, you'll likely get inaccurate results, and should use Math.floor.

Also an alternative to `~~x` is also `x | 0` (or `0 | x`, `x << 0`, etc.)

[Kushagra Kasbi](https://hashnode.com/@kkasbi)

[Nov 20, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb7fc7e1b7ab0041800c61b)

Excellent article. Very helpful.

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 22, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb7fc7e1b7ab0041800c61b#reply-5fbaafbef16aa414b7d27aa1)

Thanks @kushagra

[Murewa Ashiru](https://hashnode.com/@murewaashiru)

[Nov 20, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb7c3edba1e08716c77f3ea)

Amazing! Thanks for sharing

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 20, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb7c3edba1e08716c77f3ea#reply-5fb7c430ba1e08716c77f3f7)

Welcome

[Maxi Contieri](https://hashnode.com/@mcsee)

[Nov 18, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb547a1cb142d6dcc93beb0)

Amazing Article and great examples !

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 20, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb547a1cb142d6dcc93beb0#reply-5fb7c445ba1e08716c77f3fe)

Thanks for noticing the examples. Glad you liked it

[Ricardo Luz](https://hashnode.com/@rxluz)

[Nov 18, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb4e6dab589f1618af9e7e9)

Amazing post! Very cool the way that you deleted the array 😃

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 20, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb4e6dab589f1618af9e7e9#reply-5fb7c44f08ea5d7167d7154b)

Haha thank you

[Shad Mirza](https://hashnode.com/@iamshadmirza)

[Nov 18, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb4af74b589f1618af9e30c)

Great read [Hrithwik Bharadwaj](https://hashnode.com/@hrithwik). Looking forward to reading more from you. 😄

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 18, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb4af74b589f1618af9e30c#reply-5fb4b8a4b589f1618af9e480)

Thank you [Mohd Shad Mirza](https://hashnode.com/@iamshadmirza) :)

[Andrey Radkevich](https://hashnode.com/@andreyradkevich)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb42885b589f1618af9dc90)

if you know types of compared values, you don't need ===

[Darlan Tódero ten Caten](https://hashnode.com/@darlantc)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb42885b589f1618af9dc90#reply-5fb42effa73df361ab711874)

In Javascript the == is very dangerous and should be avoided.

![== vs === in Javascript](https://i.stack.imgur.com/yISob.png)

[Rachna](https://hashnode.com/@Rachna)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb4286da73df361ab7117e9)

Very well explained @hrithwik

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb4286da73df361ab7117e9#reply-5fb4295bb589f1618af9dcad)

Thanks Rachna

[Pradyoth P](https://hashnode.com/@ppradyoth)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb40383b589f1618af9da38)

I'm new to js not familiar with most of these, but this is really really helpful to refer when needed. Thanks for sharing 👍

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb40383b589f1618af9da38#reply-5fb41783a73df361ab7116f6)

Yes indeed. Always attack the fundamentals before starting any concept or language.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3f19fb589f1618af9d7a0)

Good one, thanks for sharing!

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3f19fb589f1618af9d7a0#reply-5fb3fa04b589f1618af9d88a)

Welcome sir

[Favourite Jome](https://hashnode.com/@Favourite)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3d386b589f1618af9d484)

Very well detailed 👍

Thanks for the mention 😊

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3d386b589f1618af9d484#reply-5fb3d4fcb589f1618af9d4c1)

Thanks Jome

[Rahul](https://hashnode.com/@rahulkamath)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3d070a73df361ab71100e)

Very helpful

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3d070a73df361ab71100e#reply-5fb3d0c3a73df361ab71102c)

Good to know. Promises > callbacks

[Rajendra Basu](https://hashnode.com/@BasuRaj)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3ceadb589f1618af9d3c5)

I just came here seeing Gilfoyle lmao

[Rahul](https://hashnode.com/@RAHULISM)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3ceadb589f1618af9d3c5#reply-5fb3d62aa73df361ab711142)

Try installing Grammarly addon. It will irritate you for wrong spelling. [Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3ceadb589f1618af9d3c5#reply-5fb3d6daa73df361ab711158)

I have it installed but it acts weirdly on my firefox browser. Sometimes works sonetimes doesn't[Rahul](https://hashnode.com/@rahxul)

[Rahul](https://hashnode.com/@RAHULISM)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3ceadb589f1618af9d3c5#reply-5fb3d9afb589f1618af9d56b)

Ah! I agree I also use firefox developer edition max times it works fine. [Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Yezni](https://hashnode.com/@Yesnie)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3ce34a73df361ab710f9b)

YESS . Never use "var" .

[Yezni](https://hashnode.com/@Yesnie)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3ce34a73df361ab710f9b#reply-5fb3ce55a73df361ab710fac)

Also liked your hoisting explanation. Good job [Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Rahul](https://hashnode.com/@RAHULISM)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3cdc6a73df361ab710f8f)

Thanks for the mention. Nice post btw.

[Hrithwik Bharadwaj](https://hashnode.com/@hrithwik)

[Nov 17, 2020](https://hashnode.com/posts/10-best-javascript-practices-recommended-by-top-developers/5fb3cc09a73df361ab710f3c/comment/5fb3cdc6a73df361ab710f8f#reply-5fb3d017b589f1618af9d3f7)

Thank you Rahul
