DEV Community

Cover image for 4 things you might not know about javascript.
iFTekhar
iFTekhar

Posted on • Updated on

4 things you might not know about javascript.

Hey in this article I am going to be showing some unique things that you may not know about javascript! enjoy guys!

1) The -0

Did you know that javascript has a -0 number? we actually use the +0 number as default but you know what they return 0 anyway so both of them are equal.

Alt Text

2) NaN (Not a number) is a special number!

If you didn't know NaN is actually a special number. if you don't believe me just use the code that is given below and you would be surprised!

One more weird and interesting thing about this is NaN is not equal to itself meaning NaN !== NaN

Alt Text

3) Setting and reading the urlparams using searchParams

You can use the search params to get the value of any param and also you can set a param with a value using this.

image

4) Some cool icons using HTML Entity

There are some basic icons that you might wanna use in your site so instead of importing font and do all those time-consuming things

you can use some cool icons using the HTML Entity some examples are given below

image

image

That was it! Thank you for reading my article hope you enjoyed it and let me know if you like this little article of mine. Thank you so much for reading this!🙂

Top comments (4)

Collapse
 
diegolepore profile image
Diego Palacios Lepore

Great article! 😃 Learning JS seems to be an endless road yet an exiting one as well.

BTW, regarding NaN, I wrote an article a few months ago, here's the link in case you wanna take a look:

dev.to/diegolepore/nan-isnan-numbe...

Cheers!

Collapse
 
iftekhs profile image
iFTekhar

Thank you so much glad you liked it! enjoy.🔥

Collapse
 
glebirovich profile image
Gleb Irovich

Hey. Seems you forgot the 5th thing 🤔

Collapse
 
iftekhs profile image
iFTekhar

Oh man,😂 Thanks for pointing it out.