Yogesh Chauhan's Blog

Values and Types Basics in JavaScript

in JavaScript on February 27, 2020

Numbers

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

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"

Strings

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 How to check if radio button is checked or not using JavaScript? #2 How to add Read More Read Less Button using JavaScript? #3 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#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 #Jan 14 How to display a student’s individual transcript in Colleague? #Jan 11 How to install PuTTY on a MacOS?
You might also like these
What does it mean by Continuous Integration, Continuous Delivery and Continuous Deployment?MiscellaneousWordPress: How to display fields from ACF Flexible Contents?WordPressWhat’s a Log File and What are Log File Monitors?MiscellaneousHow to add AppRoutingModule in Angular application using command line?AngularHow to convert an object from API to JSON array in Angular 9?AngularCreate a galley with overlapping images using CSS gridCSSLEFT JOIN in PostgresPostgresWhat’s a Strict mode in JavaScript?JavaScriptTackle Accessibility in React with JSXReactFull and Partial ROLLUP in Postgresql with ExamplesPostgresCustom Post Type Template Files in WordPressWordPress12 URLSearchParams methods in JavaScriptJavaScript