Below I have the simplest code. In my name function its all good, it works but in the User_age function I get the following error:
User_age is not a function.
What am I doing wrong?
User_age();
function User_age()
{
var age = promt("what is your age");
var printAge = "your age is" + age;
console.log(printAge);
}
name();
function name(){
var username = prompt("what is your name");
var greed = "hello" + username;
console.log(greed);
}
you have a small issue in your first function you are typing promt not prompt
User_age();
function User_age()
{
var age = prompt("what is your age");
var printAge = "your age is" + age;
console.log(printAge);
}
name();
function name(){
var username = prompt("what is your name");
var greed = "hello" + username;
console.log(greed);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With