Any real difference between window.prompt and prompt?
Just out of curiosity is there any difference between window.prompt and prompt in JavaScript. For one of the answers to my exam questions the teacher uses var yourName = window.prompt("Please enter your first name here\n"); and I used var yourName = prompt("Please enter your first name here\n"); It is a written exam so i felt it wouldn't make much difference. Bergi Usually yes, window.prompt === prompt . Yet it does depend on your scope, someone might have declared window or prompt variables with different values than those in the global scope. For further details have a look at Is window