0

I am seeking a way to save large integer value in javascript. I know that there is some libraries out there but I want to know whether there is a standard way to do that without bring any dependency. Below is an example of my problem:

let a = 6703734870638684097
console.log(a)

and the output becomes to:

6703734870638684000
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
  • 2
    If there were a way to do it without a library, there would be no need for those libraries to exist, no? – Pekka Nov 02 '16 at 21:06
  • @Pekka웃 [`npm left-pad`](http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/) -- just because there's a library for something, doesn't mean it can't be done without a library :P. – Heretic Monkey Nov 02 '16 at 21:14
  • @Mike Ha! True, of course, especially these days. :) But in this case, literally every Google result for `How to store big int value in javascript` says "you need a library." – Pekka Nov 02 '16 at 21:22

0 Answers0