Ajay Yadav
Ajay Yadav

@ATechAjay

11 Tweets Apr 08, 2022
๐Ÿ’› Day 3๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series
โ†’ What is the number data type?
โ†’ How many number data types are in javaScript?
โ†’ What is + - infinity?
โ†’ What is NaN?
โ†’ How to make numbers more readable in javaScript?
#javascript30
Let me explain!๐Ÿงต๐Ÿ‘‡
๐Ÿ“Œ What is the number data type?
โ†’ Number data type represents integers and floating points number.
โ†’ Or, number data type acts as integers(665) and floating numbers(54.656) in javaScript.
๐Ÿ“Œ How many number data types are in javaScript?
๐Ÿ‘€ There are 2 "number" data types in javascript.
1๏ธโƒฃ number
2๏ธโƒฃ bigInt (for big integers / ends with "n", more about a bit later)
โ›” Apart from the regular number data type, there are 3 "special numeric values" that belong to the number data type.
๐Ÿ‘€ - Infinity
๐Ÿ‘€ + Infinity
๐Ÿ‘€ NaN
๐Ÿ“Œ What is + - infinity?
๐Ÿ˜ Simple as mathematics!
๐Ÿ‘€ - infinity 0 + infinity
๐Ÿ“Œ What is NaN?
โ†’ NaN stands for Not A Number.
โ†’ Or, which result is not a number that is NaN.
โ†’ Or, it shows when incorrect results occured.
๐Ÿ‘€ Suppose if you want to divide a character with a number then, of course, it's not a valid expression, so the result of this expression will be NaN.
โ›”But this is working, because of "coercion"
๐Ÿ’ก We will talk about this in upcoming threads.
๐Ÿ“Œ How to make numbers more readable in javaScript?
โ†’ We can use underscore( _ ) for digit separation.
โ†’ That's why your number will be more readable.
โ†’ JavaScript engine simply ignores that underscore between the numbers.
๐Ÿ’š That's all for now, we will meet in the next thread!
But if you like make sure to:
1. Follow me @ATechAjay
2. Retweet the first tweet.
3. Turn on the notification to never miss these amazing tweets.
Thank you so much for staying to the end of this thread.

Loading suggestions...