Ran across this great CodePen today, by Liam Egan!
Here’s just one of many samples found at the link above.
See the Pen Genuary 1 – 10,000 by Liam Egan (@shubniggurath) on CodePen.
IT Professional
Ran across this great CodePen today, by Liam Egan!
Here’s just one of many samples found at the link above.
See the Pen Genuary 1 – 10,000 by Liam Egan (@shubniggurath) on CodePen.
Need to work with a really big number in JavaScript? Larger than a normal int? BigInt is your answer!
Say, for example, you were trying to solve the “A Very Big Sum” problem on HackerRank. The code is simple with BigInt():
function aVeryBigSum(ar) {
// Write your code here
let sum = 0n;
for (let i = 0; i < ar.length; i++) {
sum = sum + BigInt(ar[i]);
}
return sum;
}