In the JavaScript code you should manage data from uint256 as BigNumbers. Elsewhere JavaScript cannot handle your data properly because there is not a native matching type in JavaScript. Make just some research on the matter, you should be able to solve easily. There are many examples here to, on this forum, just search for BigNumbers tag or search term.