YogeshChauhan . com

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.

amazon

Most Read

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

Recently Posted

Jun 16 What are Stored Procedures for SQL Server? Jun 16 What are Class Constants in PHP? Jun 15 A short basic guide on states in React Jun 15 How to define constants in PHP? Jun 15 How to define visibility for a property in PHP? Jun 15 How to use @if and @else in SCSS?

You might also like these

Angular: Templates, directives, data binding, Services and dependency injectionAngularHow to Use the EXISTS and NOT EXISTS Operator with a Subquery in SQL and MySQL?SQL/MySQLStyling Lists with CSSCSSThe SELECT DISTINCT Statement in SQLSQL/MySQLWhat are “holes” in a React component?ReactHow to make WordPress main stylesheet (style.css)?WordPressHow to insert Bootstrap 4 in Angular 9 app?AngularCheck if mixin is being called in a style rule or not in SCSSSCSSHow to create a sticky menu pin using CSS?CSSCan We Use For Loop to Loop Through Associative Arrays in PHP?PHPHTML canvas methodsHTMLWhat are partials in SCSS (Sass)?SCSS