I tried this but i always get wrong value on the last index of given string.
let n= '9875987598759875';
let g= Math.floor(Number(d));
console.log(g);
I am getting this in the output = 9875987598759876
I notice this always happens whenever the last index of my string got any odd value, any ideas ?