๐Ÿ’› 10 JavaScript Unknown Facts that every developer must know . I bet you don't know many of them ๐Ÿ˜‰

A Thread ๐Ÿงต ๐Ÿ‘‡

#100DaysOfCode #Javascript #Coding #code #programming #CodeNewBie #DEVcommunity
1๏ธโƒฃ Check this code below ๐Ÿ‘‡

Numbers as string can subtract , multiply , divide other Numbers and numbers as string (except Addition ) and return an integer value. Don't worry , it's a bug of JavaScript !! Image
2๏ธโƒฃ How 010 = 8 ?

It happens in JavaScript because every number containing a "0" in front of it is referred as an octal number . And as octal 10 = decimal 8 that's why it will return 8 !! Image
3๏ธโƒฃ Did you know that string function returns a string but "new String ()" returns an object !!

See below ๐Ÿ‘‡ Image
4๏ธโƒฃ If you convert "null" to a number it will return 0 . That's why 10 + 0 will be 10 !! Image
5๏ธโƒฃ {} === {} Will return false because "{}" is an object and object can never be equal another object as they have unique identifiers. Image
6๏ธโƒฃ Comma operator
"," is an operator that separates expressions and returns the last expression in the chain.๐Ÿ‘‡ Image
7๏ธโƒฃ IIFE :-
IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined. Image
8๏ธโƒฃ You can make a new scope by using "{}" (no need for a function or if-else statement ) . ๐Ÿ‘‡ Image
9๏ธโƒฃ If you want to measure the performance time of your Js program , than you need not use date/time . You can use performance.now() like this ๐Ÿ‘‡ Image
๐Ÿ”Ÿ In JavaScript , typeof null will return Object . But if you use null instanceof Object , this will return false !! That's because it's a big of JavaScript ๐Ÿ‘‡ Image
That's all guys for this thread !

If you find this thread useful then,

๐Ÿ“Œ Retweet the first tweet.

๐Ÿ“Œ Like all the tweets.

๐Ÿ“Œ Follow me (@Tony_Codezz ) and turn on my notifications.

Note:- Your support motivates me.

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with #It's Tony Stark ๐Ÿ‘จโ€๐Ÿ’ป

#It's Tony Stark ๐Ÿ‘จโ€๐Ÿ’ป Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(