DEV Community

Discussion on: Daily Challenge #119 - Adding Big Numbers

Collapse
 
wheatup profile image
Hao • Edited

There's a BigInt type in vanilla javascript, why not just use that instead?

const add = (a, b) => (BigInt(a) + BigInt(b)).toString();
add("10000000000000000000", "3");   // 10000000000000000003
Enter fullscreen mode Exit fullscreen mode
Collapse
 
svmarinez profile image
Sara Vasquez

BigInt isn't supported for this one. There was another kata that was multiplying big numbers by a different author and they allowed it, but I guess that's not the route they wanted folks to take.