I am newbie with javascript and I am writing a very simple javascript according to the textbook and here is the code
var location1 = 3;
var location2 = 4;
var location3 = 5;
var guess;
var hits = 0;
var guesses = 0;
var isSunk = false;
while (isSunk == false) {
guess = prompt("Ready, aim, fire! (enter a number from 0-6):") // prompt instead of promt
if (guess < 0 || guess > 6) {
alert("Please enter a valid cell number!");
} else {
guesses = guesses + 1;
if (guess == location1 || guess == location2 || guess == location3) {
alert("HIT!");
hits = hits + 1;
if (hits == 3) {
isSunk = true;
alert("You sank my battleship!");
}
} else {
alert("MISS");
}
}
}
var stats = "You took " + guesses + " guesses to sink the battleship, " +
"which means your shooting accuracy was " + (3 / guesses);
alert(stats);
Then, I installed nodejs, and tried to run this file by many ways. but it said to me many error. The 1st error is, when I ran it directly
Object expected
800A138F
microsoft jscript runtime error
the second error is, when I ran it by the command node battleship.js, here is the error

As you can see in the picture, it said to me that promt is not defined. My problem is, I ran another code no problem. Which means nodejs no problem. And, I ran my code online no problem, which means my code no problem.
So, how can I fix this one ? Could you please help me with this ? Thank you very much for your time.
prompton the server-side...Is this a part of API? If you looking forpromptthat works exactly like in clien-size then It's not available on the server-side...