I am just trying to add 1 to a big number if some conditions are met. Here is my javascript:
console.log('n1->'+n1+ ' - ' + typeof(n1) );
console.log('n2->'+n2);
if(n1 != null && n2 != n1){
console.log('adding 1');
n2 = n1 + 1;
}
console.log('n2->'+n2);
And here is the console output:
n1->443751754287812600 - number
n2->null
adding 1
n2->443751754287812600
I was expecting having n2=443751754287812601
or even n2=4437517542878126001
. Can you explain why it is not working? and how to do the sum correctly?
Thanks for your help.