Decisions, descisions


#1

I need help on Decisions, decisions on how to make my condition on line one true.


#2

@baefyoede
Can you give us the code and explain us in more detail what is your problem so we can help you?


#3

if( "myName".length 10 >= 7 ) {
console.log("You have a long name")
}


#4

I'm not sure what's wrong with my Syntax, I guess.


#5

@baefyoede

You are testing out if the length of "myName" is greater or equal to 7 but you added a 10 between the property .length and >= 7. Remove the 10 and it should work. Don't forget to add a semicolon at the end of console.log("You have a long name") so JavaScript knows it's the end of the instruction.


#6

Thanks, man. I'll keep you posted, to your utter horror.


#7

if ("myName".length >= 7 ) {
console.log("Let's go down the first road!");
}
else {
}

console.log("Let's go down the second road!");
}


#8

Need some more help. This is my first time, anyhow.


#9

@baefyoede

Seems that you closed the curly bracket in else statement directly (your console.log is outside of your else statement!).


#10

if ("myName".length >= 6 ) {
console.log("Let's go down the first road!");
}
else { console.log("Let's go down the other road.");

}

};


#12

@baefyoede
Remove your extra curly brace at the end with the semicolon.


#13

Hi baefyoede
Why did you quote variable "myName"? ."."(dot) means that you call method length() for a string "myName", is an error. There has to be an object myName that store a value string type, actually is its attribute.
correct code is :
if (myName.length >= 7 ) {.....}
without quote
Hope heps you


#14

Please make sure whether you created a variable myName and assigned a value e.g. string type like this
myName = "Ali Baba"

Furthermore please check your syntax, JS require or not semicolon after each "}"