We can understand it by an example:-
var value = "";
var name = prompt("Please enter your name", "Vishal");
if (name != null)
value = name;
So,it's easy to understand about Prompt.