+ 1
Hey how do you use prompt info later in the code? JS
This is my code: function p(){ prompt("What is your name?"); } p(); var name = p(); document.write(name); How would I implement this correctly?
2 odpowiedzi
+ 4
function p(){
let name = prompt("What is your name?");
return name;
}
//p();
var name = p();
document.write( name );
+ 2
Jayakrishna🇮🇳 oh return! That makes sense. Thank you so much!