Yogesh Chauhan's Blog

Values and Types Basics in JavaScript

in JavaScript on February 27, 2020


We can write down numbers with or without decimals. For e.g. var x = 3.14 , var y = 3

To write down extra large or extra small numbers, we need to use exponent notation. For e.g. var x = 123e5 , var y = 123e-5

Unique Numbers

There are “special numeric values” which also called Unique Numbers. For e.g. Infinity, -Infinity and NaN. Infinity represents the mathematical Infinity ∞. It is greater than any number.


NaN actually is a computational error. It is a result of an incorrect or an undefined mathematical operation. The NaN property represents "Not-a-Number" value which indicates that a value is not a legal number. NaN compares unequal (via ==, !=, ===, and !==) to any other value — including to another NaN value.

To write down extra large or extra small numbers, we need to use exponent notation. For e.g. NaN === NaN; will output "false", isNaN(NaN) will output "true"


A string can contain zero or more characters written inside quotes. For e.g. var car='Tesla', var car="Tesla" , both are same.

Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
CSS backface-visibility PropertyCSSHow services and dependency injection work in Angular?AngularWhat’s new in Constructor in PHP 8?PHPWhat’s a Strict mode in JavaScript?JavaScriptObject destructuring in JavaScript: Unpacking fields from objects passed as function parameterJavaScriptHow to verify your domain in Google Console with a TXT record?MiscellaneousColleague UI Basics: The Context AreaColleagueHow different is Handling Events in React vs HTML DOM?ReactHow to create a simple text and image slider using CSS and JavaScript?CSSWhat is React? Learn the basicsReactAt-rules: @error and @warn in SCSSSCSSHow to Use password_hash and password_verify to Secure Your User’s Data (Especially Passwords)?PHP