Integer Range in JavaScript Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will know the different ranges of an integer variable in JavaScript. To get the ranges, we will use the MAX_VALUE and MIN_VALUE properties of ES5 JavaScript and the MAX_SAFE_INTEGER and MIN_SAFE_INTEGER properties of ES6 JavaScript. The MAX_VALUE represents the biggest possible numeric value of a positive number that can be represented in JavaScript with the value 1.79E+308. The MIN_VALUE represents the smallest possible positive number representable in JavaScript within float precision with the value 5E-324(>0). The MAX_SAFE_INTEGER is a constant number that represents the minimum safe integer with the value (253 – 1). The MIN_SAFE_INTEGER is a constant number that represents the negative value of the MAX_SAFE_INTEGER with the value (-1)x(253-1). We will understand the above concept through examples. Example 1: To show the range of the integer using MAX_VALUE and MIN_VALUE of ES5 JavaScript. JavaScript <script> function Range() { document.write("The minimum value of integer is: " + Number.MIN_VALUE + "<br>"); document.write("The maximum value of integer is: " +Number.MAX_VALUE+"<br>"); } Range(); </script> Output: The minimum value of integer is: 5e-324 The maximum value of integer is: 1.7976931348623157e+308 Example 2: To show the range of the integer using MAX_SAFE_INTEGER and MIN_SAFE_INTEGER of ES6 JavaScript. JavaScript <script> function Range() { document.write("The minimum value of integer is: " + Number.MIN_SAFE_INTEGER + "<br>"); document.write("The maximum value of integer is: " +Number.MAX_SAFE_INTEGER+"<br>"); } Range(); </script> Output: The minimum value of integer is: -9007199254740991 The maximum value of integer is: 9007199254740991 Comment More infoAdvertise with us Next Article Integer Range in JavaScript A anuragsingh1022 Follow Improve Article Tags : Technical Scripter JavaScript Web Technologies Technical Scripter 2022 JavaScript-Questions +1 More Similar Reads JavaScript Number isInteger() Method The Number.isInteger() method in JavaScript is useful for checking whether a number is a whole number or not. Syntax:Number.isInteger(value);Parameters:value: The value to be checked.Return Value:It returns a boolean value,i.e. either true or false. It will return true if the passed value is of the 1 min read Convert a String to an Integer in JavaScript These are the following ways to convert string to an integer in JavaScript:1. Using Number() MethodThe number() method converts a string into an integer number. It works similarly to the unary plus operator. JavaScriptlet s = "100.45"; console.log(typeof Number(s));Outputnumber 2. Using Unary + Oper 2 min read JavaScript BigInt Reference JavaScript BigInt is an inbuilt object in JavaScript that provides a way to represent whole numbers larger than 253-1 which is the largest number that can represent with the Number primitive. It is represented by the MAX_SAFE_INTEGER constant.Example: This example creates a BigInt by appending n at 2 min read JavaScript BigInt JavaScript BigInt is a built-in object that represents whole numbers larger than (2^{53} - 1). A BigInt value, also known as a bigint primitive, is created by appending n to an integer literal or by calling the BigInt() function with an integer or string value. It allows precise arithmetic with inte 4 min read JavaScript Number isSafeInteger() Method What is a Safe Integer? A safe integer is an integer that has the following properties A number that can be represented as an IEEE-754 double precision number i.e. all integers from (253 - 1) to -(253 - 1)).What is an IEEE-754 double-precision number? Double-precision floating-point format is a comp 2 min read Like