The Wayback Machine - https://web.archive.org/web/20240814121802/https://www.geeksforgeeks.org/javascript-number-max_value-min_value-property/
Open In App

JavaScript Number MAX_VALUE & MIN_VALUE Property

Last Updated : 22 May, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

JavaScript Number.MAX_VALUE and Number.MIN_VALUE is used to represent maximum and minimum numeric values in javascript. 

Syntax:

Number.MAX_VALUE 
Number.MIN_VALUE 

Return Type: Both Number.MAX_VALUE and Number.MIN_VALUE returns a numeric value.

  • MAX_VALUE has a value of approximately 1.79E+308. The values are larger Number.MAX_VALUE are termed as Infinity. 
  • MIN_VALUE has a value of approximately 5e-324. The values are smaller than the Number.MIN_VALUE are termed as underflow values. 
  • Both MAX_VALUE and MIN_VALUE are static properties of Number. Therefore using x.MAX_VALUE or x.MIN_VALUE will return undefined where x is a Number or Number Object.

Example 1: In this example, we will print the maximum value

javascript




function GFGFun() {
    // Undefined Behaviour
    let res = Number.MAX_VALUE;
    console.log(res);
}
GFGFun();


Output : 

1.7976931348623157e+308

Example 2: In this example, we will print the minimum value

Javascript




function GFGFun() {
    // Undefined Behaviour
    let res = Number.MIN_VALUE;
    console.log(res);
}
GFGFun();


Output:

5e-324

Supported Browsers:

  • Chrome 34 and above
  • Internet Explorer (Not Supported)
  • Firefox 31 and above
  • Edge 12 and above
  • Safari 9 and above
  • Opera 21 and above

We have a complete list of JavaScript Number constructor, properties, and methods list, to know more about the numbers please go through that article.


Previous Article
Next Article

Similar Reads

JavaScript Number.MIN_VALUE Property
Number.MIN_VALUE is the smallest possible positive number representable in JavaScript within float precision. It does not represent the most negative number, instead of that, it possesses the value of the smallest positive number which is closest to 0. Syntax: Number.MIN_VALUEReturn Value: It has approximately a value of 5E-324(>0). But in pract
2 min read
JavaScript Number.MAX_VALUE Property
Number.MAX_VALUE represents the biggest possible numeric value of a positive number that can be represented in JavaScript. It is the maximum possible positive number representable in JavaScript within float precision. The values greater than Max_VALUE are represented as infinity. Syntax: Number.MAX_VALUEReturn Value: It possesses the value of the b
2 min read
JavaScript Logical AND assignment (&&=) Operator
This operator is represented by x &&= y, and it is called the logical AND assignment operator. It assigns the value of y into x only if x is a truthy value. We use this operator x &&= y like this. Now break this expression into two parts, x && (x = y). If the value of x is true, then the statement (x = y) executes, and the v
2 min read
HTML & CSS | Tabindex attribute & Navigation bars
The tabindex attribute specifies the tab order of an element. "tab" button is used for navigation. The tabindex content attribute allows users to control whether an element is supposed to be focusable, whether it is supposed to be reachable using sequential focus navigation, and what is to be the relative order of the element for the purposes of se
2 min read
Google Amp amp-ad
Introduction: We use this component to make a container to display an ad in AMP HTML files. Official Site: https://amp.dev/ Required Script: Import the amp-ad component in the header <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"> </script> Attributes: Placeholder - amp-ad sup
2 min read
'AND' vs '&&' as operator in PHP
'AND' Operator The AND operator is called logical operator. It returns true if both the operands are true. Example: PHP Code <?php // Variable declaration and // initialization $a = 100; $b = 50; // Check two condition using // AND operator if ($a == 100 and $b == 10) echo "True"; else echo "False"; ?> Output:False Explana
3 min read
How to create Inline amp-addthis in Google AMP ?
Introduction: Some times as a web developer we want to share our social media links and for that, we have to show the social media buttons and amp-addthis is made solely for this purpose. The amp-addthis component integrates the AddThis Floating Bar and Inline Share Buttons. Setup: You have to import amp-addthis component in your header to use this
3 min read
Google AMP amp-access
Sometimes, as a designer, you want to please your users and for that, you decide to give premium content to the premium users but to keep them distinct might be a difficult challenge. The amp-access tag is specially designed for the sole purpose to do so. It can set controls for logged-in users, premium members and non-logged-in users. By using thi
4 min read
Google AMP amp-access-laterpay
Many publishers would like to add an easy payment infrastructure platform to their website, and the amp-access-laterpay tag is just for this purpose. It helps the publisher to easily integrate a payment platform on their webpage. It uses AMP Access and LaterPay to do so. Setup: To use the amp-access-laterpay tag you have to add certain scripts and
4 min read
How to set custom media notification with amp-audio in Google AMP ?
Since the release of HTML5, audios can be added to webpages using the “audio” tag. Previously audios could be only played on webpages using web plugins like Flash. The “audio” tag is an inline element which is used to embed sound files into a web page. It is a very useful tag if you want to add audio such as songs, interviews, etc on your webpage.
3 min read
Google AMP amp-accordion
Introduction: Sometimes we have a lot of content to display and to make the website look pretty and short we make use of the collapsible textboxes. Collapsible textboxes are that division which is the combination of heading and content, generally only heading is visible but when it is hit the content is displayed. Setup: You have to import amp-acco
3 min read
How to create Nested Accordion using Google AMP amp-accordion?
Introduction: Sometimes we have a lot of content to display and to make the website look pretty and short we make use of the collapsible textboxes. Collapsible textboxes are that division which is the combination of heading and content, generally only heading is visible but when it is hit the content is displayed. Setup: You have to import amp-acco
3 min read
How to create Hidden Header using Google AMP amp-accordion?
Introduction: Sometimes we have a lot of content to display and to make the website look pretty and short we make use of the collapsible textboxes. Collapsible textboxes are that division which is the combination of heading and content, generally only heading is visible but when it is hit the content is displayed. Setup: You have to import amp-acco
2 min read
How to create Dynamic Header using Google AMP amp-accordion?
Introduction: Sometimes we have a lot of content to display and to make the website look pretty and short we make use of the collapsible textboxes. Collapsible textboxes are that division which is the combination of heading and content, generally only heading is visible but when it is hit the content is displayed. Setup: You have to import amp-acco
2 min read
How to mute the audio using amp-audio of Google AMP ?
Introduction: Since the release of HTML5, audios can be added to webpages using the “audio” tag. Previously audios could be only played on webpages using web plugins like Flash. The “audio” tag is an inline element which is used to embed sound files into a web page. It is a very useful tag if you want to add audio such as songs, interviews, etc on
2 min read
How to toggle the visibility of division using amp-bind in Google AMP?
Introduction: Sometimes you want to add custom interactivity to your AMP pages to make your pages look more user friendly and user calling. Although AMP's pre-built components are limited, so amp-bind is made to overcome this problem. It helps the developer to add custom interactivity to the pages without using AMP's pre-built components. Setup: To
3 min read
Google AMP amp-facebook-like
Introduction: A really popular featured in web pages are like button from social media platforms. The amp-facebook-like is used to embed a Facebook like button to an AMP HTML page. Here when a Facebook like button is embedded you can like the post without going to Facebook itself. Required Script: Add the following script containing source to impor
2 min read
Google AMP amp-date-countdown
The amp-data-countdown is used to count down to a specific date which is rendered to the AMP HTML page. It is specifically used as a timer or count-down. Required Scripts: Adding the amp-data-countdown component. C/C++ Code <script async custom-element="amp-date-countdown" src= "https://cdn.ampproject.org/v0/amp-date-countdown-0.1
2 min read
Google AMP amp-brightcove
The Brightcove Video Cloud is an online platform used to host videos. The amp-brightcove is an amp component which is used to embed a brightcove video perform player or a brightcove video cloud. Required Scripts: Importing brightcove component in the header C/C++ Code <script async custom-element="amp-brightcove" src= "https://cdn
2 min read
Google AMP amp-autocomplete
The amp-autocomplete suggests complete results according to the input given by the user as they type. It is a very common and helpful feature as it enables users to complete there task more quickly. This is extremely useful when the user does not know the full range of the input. Required Scripts: Import the amp-autocomplete component - C/C++ Code
4 min read
How to disable download option in amp-audio in Google AMP ?
Since the release of HTML5, audios can be added to webpages using the “audio” tag. Previously audios could be only played on webpages using web plugins like Flash. The “audio” tag is an inline element which is used to embed sound files into a web page. It is a very useful tag if you want to add audio such as songs, interviews, etc on your webpage.
3 min read
How to set an image placeholder for amp-anim in Google AMP ?
If you want to embed an animation on your AMP webpage then you can do so with this tag. It helps the developer to embed animations, gif, webp, etc in your web platform. It is really a very useful tag as having animation on your website really make it tacky and good-looking. Setup: To use amp-anim in your AMP webpage, you have to import this script.
2 min read
How to set audio loop in amp-audio of Google AMP ?
Since the release of HTML5, audios can be added to webpages using the “audio” tag. Previously audios could be only played on webpages using web plugins like Flash. The “audio” tag is an inline element which is used to embed sound files into a web page. It is a very useful tag if you want to add audio such as songs, interviews, etc on your webpage.
2 min read
Google AMP amp-img
AMP HTML pages do not support the standard img tag, we use amp-img component to insert images in AMP HTML pages. The amp-img component does not require a script to be embedded in the header as it comes amp runtime. Script Required: The amp-img is a built-in element so is automatically imported via AMP runtime. C/C++ Code <script async src=
2 min read
Google AMP amp-image-lightbox
An image gallery is a popular feature in websites and with amp-image-lightbox developers can add lightbox effects easily to AMP HTML pages, to activate the amp-image-lightbox we use the on action on amp-image component. Required Script: Importing the amp-imag-lightbox component into the header. C/C++ Code <script async custom-element="amp-i
2 min read
Google AMP amp-lightbox-gallery
The amp-lightbox-gallery component is used to give a lightbox experience for other amp components like amp-carousel, amp-img. Presently only images are supported by amp-lightbox-gallery. Required Script: Importing the amp-lightbox-gallery component into the header. C/C++ Code <script async custom-element="amp-lightbox-gallery" src=
2 min read
How to calculate area of circle dynamically using amp-bind-macro in Google AMP ?
With the help of amp-bind-macro, one can create an HTML program to calculate the area of circle dynamically. When the input is given, the page will respond to the user input, find the area of the circle with the radius provided and print it without refreshing the page. Setup: To use amp-bind-macro in our AMP page, we have to import amp-bind script
2 min read
What is Initialize state in amp-bind of Google AMP ?
The amp-bind is made in such a way that any document using it has a mutable JSON data or state. This data can be manipulated using amp-state. Your data is not evaluated on page load but dynamically evaluated along with user input. It has various state and they have their own variable. In this article, we will talk about the initial state of the ele
2 min read
How to change/update image size dynamically using amp-bind in Google AMP ?
Sometimes you want to add custom interactivity to your AMP pages to make your pages look more user-friendly and user calling. Although AMP's pre-built components are limited, so amp-bind is made to overcome this problem. It helps the developer to add custom interactivity to the pages without using AMP's pre-built components. You can use amp-bind to
2 min read
How to change/update CSS class dynamically using amp-bind in Google AMP ?
Sometimes you want to add custom interactivity to your AMP pages to make your pages look more user-friendly and user calling. Although AMP's pre-built components are limited, so amp-bind is made to overcome this problem. It helps the developer to add custom interactivity to the pages without using AMP's pre-built components. You can use amp-bind to
3 min read
Article Tags :
three90RightbarBannerImg