Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript BigInt

// BigInt value
const value1 = 900719925124740998n;

// Adding two big integers
const result1 = value1 + 1n;
console.log(result1); // "900719925124740999n"

const value2 = 900719925124740998n;

// Error! BitInt and number cannot be added
const result2 = value2 + 1; 
console.log(result2);
Source by www.smashingmagazine.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #BigInt
ADD COMMENT
Topic
Name
3+7 =