Integer Comparison
javascript
Solution
You'd better to assign the radix. Ex. `parseInt('08')` will give `0` not `8`.
if (parseInt(test, 10) === parseInt(actual, 10)) {
Problem
I need to compare two Integers which could exceed Integer range limit. How do I get this in javascript. Initially, I get the value as String, do a parseInt and compare them. ``` var test = document.getElementById("test").value; var actual = document.getElementById("actual").value; if ( parseInt(test) == parseInt(actual)){ return false; } ``` Any options to use long ? Also, which is best to use parseInt or valueOf ?? Any suggestions appreciated, Thanks