A JS function with a prompt argument. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

A JS function with a prompt argument.

I want the argument inside the given function as input given by the user.For example : function sayHello(name) { alert("Hi, " + name); } sayHello(prompt("type your name.")); The name should be the input.How it can be done?

23rd Nov 2019, 6:26 PM
atta ul momin
atta ul momin - avatar
1 Answer
23rd Nov 2019, 6:44 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar