Please may someone help me with 2 unit 2


#1

confirm("what's your age")
var age=14("what's your age")
if (age===>13 )
{
console.log
}
else
{
("you cant play this")
here is what I put what have I done wrong?


#2

make this something like confirm("Are you ready to play?");

This needs to be var age = prompt("How old are you?");

for this you want

if(age >= 13) {
  console.log("You can play this") ;
} else {
  console.log("You can't play this");
}

I Suggest you go back a couple lessons and just go over if/else statements and how to use console.log


#3

semicolons missing and the if statement may also have some problems


#4

var name = "minhaj";
var age;
console.log("enter the age=");
if(age==4){
console.log(" name1");
}
can any one help me what went wrong in this i am unable to enter tha age in output


#5

I would recommend that you go back a few lessons so you actually understand what you're doing because a lot if this is wrong.

You're declaring two variables here so why does one have an = and the other a ;? The = is right but the ; is not. Go back and redo the lessons till you understand what you're actually doing.


#6

It is okay to create a variable like that. The programmer must just be aware that while the variable exists now, it is still undefined.