Skip to content

Buzzingz

Unleashing the Power of Code

  • HTML
  • CSS
  • JavaScript
  • Toggle search form

JavaScript Number Properties

Posted on April 2, 2023April 2, 2023 By shani No Comments on JavaScript Number Properties

In JavaScript, there are some useful properties associated with the number data type that can be accessed using the Number object.

Number.MAX_VALUE

Number.MAX_VALUE is the largest positive number that can be represented with the number data type in JavaScript. It has a value of approximately 1.79 × 10^308.

console.log(Number.MAX_VALUE); // Output: 1.7976931348623157e+308

Number.MIN_VALUE

Number.MIN_VALUE is the smallest positive number that can be represented with the number data type in JavaScript. It has a value of approximately 5 × 10^-324.

console.log(Number.MIN_VALUE); // Output: 5e-324

Number.POSITIVE_INFINITY

Number.POSITIVE_INFINITY represents positive infinity, which is a value that is greater than any other number. This value is returned when a number is too large to be represented with the number data type.

console.log(Number.POSITIVE_INFINITY); // Output: Infinity

Number.NEGATIVE_INFINITY

Number.NEGATIVE_INFINITY represents negative infinity, which is a value that is less than any other number. This value is returned when a number is too small (i.e. more negative) to be represented with the number data type.

console.log(Number.NEGATIVE_INFINITY); // Output: -Infinity

Number.NaN

Number.NaN represents Not-a-Number, which is a value that indicates an undefined or unrepresentable mathematical value. This value is returned when a mathematical operation cannot be performed, such as dividing zero by zero.

console.log(Number.NaN); // Output: NaN

These properties are useful for working with numbers in JavaScript, especially when dealing with large or small values.

Javascript

Post navigation

Previous Post: JavaScript Number Methods
Next Post: JavaScript Arrays

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

JavaScript Tutorial

  • JavaScript Tutorial
  • JavaScript Where To
  • JavaScript Output
  • JavaScript Statements
  • JavaScript Syntax
  • JavaScript Comments
  • JavaScript Variables
  • JavaScript Let
  • JavaScript Const
  • JavaScript Operators
  • JavaScript Arithmetic
  • JavaScript Assignment
  • JavaScript Data Types
  • JavaScript Functions
  • JavaScript Objects
  • JavaScript Events
  • JavaScript Strings
  • JavaScript String Methods
  • JavaScript String Search
  • JavaScript Template Literals
  • JavaScript Numbers
  • JavaScript BigInt
  • JavaScript Number Methods
  • JavaScript Number Properties
  • JavaScript Arrays
  • JavaScript Array Methods
  • JavaScript Sorting Arrays
  • JavaScript Array Iteration
  • JavaScript Array Const
  • JavaScript Date Objects
  • JavaScript Date Formats
  • JavaScript Get Date Methods
  • JavaScript Set Date Methods
  • JavaScript Math Object
  • JavaScript Random
  • JavaScript Booleans
  • JavaScript Comparison and Logical Operators
  • JavaScript if, else, and else if
  • JavaScript Switch Statement
  • JavaScript For Loop
  • JavaScript For In
  • JavaScript For Of
  • JavaScript While Loop
  • JavaScript Break and Continue
  • JavaScript Iterables
  • JavaScript Sets
  • JavaScript Maps
  • JavaScript typeof
  • JavaScript Type Conversion
  • JavaScript Bitwise Operations
  • JavaScript Regular Expressions
  • JavaScript Operator Precedence
  • JavaScript Errors
  • JavaScript Scope
  • JavaScript Hoisting: Understanding the Basics
  • JavaScript Use Strict: The Importance of Strict Mode in JavaScript
  • The JavaScript this Keyword
  • JavaScript Arrow Function: A Concise and Comprehensive Guide
  • JavaScript Classes: Understanding the Basics
  • JavaScript Modules
  • JavaScript JSON
  • JavaScript Debugging
  • JavaScript Style Guide
  • JavaScript Best Practices
  • JavaScript Common Mistakes: How to Avoid Them
  • JavaScript Performance: Techniques for Improving Your Code
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions

Copyright © 2023 Buzzingz.

Powered by PressBook WordPress theme