-4

I'm trying to make an alert, that prints the value of a variabile, here is my attempt.

var username = prompt("I'm LaunchBot, what's your name?");   
var print = alert() ;
Petter Friberg
  • 21,252
  • 9
  • 60
  • 109

1 Answers1

2

alert() is a function. It take a parameter between the parenthesis. So just insert your variable username between them:

var username = prompt("I'm LaunchBot, what's your name?");   
alert(username) ;

As suggested in the comment alert() doesn't return anything so do not add a variable assignment before.

Ludovic Feltz
  • 11,416
  • 4
  • 47
  • 63