My code isn't working on my JavaScript project. I want it to check if you inputted an integer or not, and if you did, check if you inputted a whole number. I expected it to accept the number "3" in my prompt
and say it was an integer. Instead, everything I put in "isn't an integer." Can someone help? Here's a copy of my code:
function changeTime() {
var changeTimee = prompt("Enter in a new amount of seconds. Leave blank or press cancel to cancel.");
console.log("You entered: " + changeTimee);
if (Number.isInteger(changeTimee)) {
if (floor(changeTimee) === changeTimee) {
if (changeTimee === "" || changeTimee === null) {
console.log("Left Blank");
} else {
seconds = changeTimee;
}
}
} else {
alert("Please enter positive integer, not a string.");
}
console.log(seconds);
}