Your basic logic is correct, but you need to handle the differences between positive and negative integer inputs. In the case of the latter, you want to start building the reversed string on the second character. Also, when returning the reversed negative number string, you need to also prepend a negative sign.
function reverseInt(int){
let intRev = "";
let start = int < 0 ? 1 : 0;
for (let i=start; i<int.length; i++) {
intRev = int[i] + intRev;
}
return int < 0 ? '-' + intRev : intRev;
}
console.log("12345 in reverse is: " + reverseInt("12345"));
console.log("-12345 in reverse is: " + reverseInt("-12345"));
Edit: Some of the answers are making use of the base string reversing functions. But, this answer attemtps to fix the problems with your exact original approach.