JavaScript BigInt asUintN() Method Last Updated : 16 May, 2023 Comments Improve Suggest changes Like Article Like Report The BigInt.asUintN() method is an inbuilt method in JavaScript that is used to wrap a BigInt value to an unsigned integer between 0 and 2width-1. Syntax: BigInt.asUintN (width, bigint); Parameters: This method accepts two parameters as mentioned above and described below: width: This parameter holds the number of bits available for the integer size.bigint: This parameter holds the integer to clamp to fit into the supplied bits. Return value: This method returns the value of bigint modulo 2width as an unsigned integer. Below examples illustrate the BigInt.asUintN() method in JavaScript: Example 1: In this example, we will see the basic use of the BigInt.asUintN() method in JavaScript. javascript <script> let maxlimit = 2n ** (64n - 1n) - 1n; function GFG(num) { (num > maxlimit) ? console.log("Number exceed the limit " + "of signed 64-bit integer!"): console.log(BigInt.asUintN(64, num)); } GFG(2n ** 16n); GFG(2n ** 32n); GFG(2n ** 64n); </script> Output: 65536n 4294967296n "Number exceed the limit of signed 64-bit integer!" Example 2: In this example, we will see the basic use of the BigInt.asUintN() method in JavaScript. javascript <script> const max = 2n ** (64n - 1n) - 1n; console.log(BigInt.asUintN(64, max)); console.log(BigInt.asUintN(64, max + 1n)); console.log(BigInt.asUintN(32, max)); </script> Output: 9223372036854775807n 9223372036854775808n 4294967295n Supported Browsers: The browsers supported by BigInt.asUintN() method are listed below: Google Chrome 67 and aboveEdge 79 and aboveFirefox 68 and aboveOpera 54 and aboveSafari 14 and above Comment More infoAdvertise with us Next Article JavaScript BigInt toLocaleString() Method S SHUBHAMSINGH10 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Methods JavaScript-BigInt Similar Reads JavaScript BigInt() Constructor The JavaScript BigInt BigInt() Constructor is used to convert any primitive data type or object to a BigInt data type. It returns a new BigInt object that represents the original value. This method is particularly useful when dealing with large numbers that exceed the safe integer limit of 900719925 3 min read JavaScript BigInt constructor Property JavaScript BigInt constructor Property in Javascript is used to return the BigInt constructor function for the object. The function which is returned by this property is just the reference to this function, not a BigInt containing the functionâs name. The JavaScript number constructor, string constr 1 min read JavaScript BigInt asIntN() Method The BigInt.asIntN() method is an inbuilt method in JavaScript that is used to wrap a BigInt value to a signed integer between -2width-1 and 2width-1-1. Syntax: BigInt.asIntN(width, bigint);; Parameters: This function accepts two parameters as mentioned above and described below: width: This paramete 2 min read JavaScript BigInt asUintN() Method The BigInt.asUintN() method is an inbuilt method in JavaScript that is used to wrap a BigInt value to an unsigned integer between 0 and 2width-1. Syntax: BigInt.asUintN (width, bigint); Parameters: This method accepts two parameters as mentioned above and described below: width: This parameter holds 2 min read JavaScript BigInt toLocaleString() Method The BigInt.toLocaleString() method is an inbuilt method in JavaScript that is used to return a string with a language-sensitive representation of this BigInt. Syntax: bigIntObj.toLocaleString(locales, options) Parameters: This method accepts two parameters as mentioned above and described below: loc 2 min read JavaScript BigInt toString() Method The BigInt.toString() method is an inbuilt method in JavaScript that is used to return a string representing the specified BigInt object. Syntax: bigIntObj.toString( radix ) Parameters: This function accepts a single parameter and it is optional. radix: It is an integer value in the range of 2 throu 1 min read JavaScript BigInt valueOf() Method The BigInt.toString() method is an inbuilt method in JavaScript that is used to return the wrapped primitive value of a BigInt object. Syntax: bigIntObj.valueOf() Parameters: This method does not accept any parameter. Return value: This method returns a BigInt representing the primitive value of the 1 min read Like