Built my own code with error "SyntaxError: missing ( before condition" Please help


confirm("Would you like to play a game?");

var travelWant = function (answer){
prompt("Tell me, do you like to ?")
if ("yes"){
    console.log( "Alright then!")
} else {
    console.log ("Find another dang game!")

var userNumber = function (number){
    prompt("Pick 1, 2, or 3 to be assigned a city!");
    if( userNumber < 2){
        console.log("We're going to SF!");
    } if else (userNumber === 2){
        console.log(" Time to get weird in portland!")
        console.log("Hit the sunny San Deigo!');

Replace this line with your code.




console.log("Hit the sunny San Deigo!');

you use a " to mark the start of your string, and a ' to mark the end of your string. That doesn't match. Use either apostrophe or quotation mark


Ah, you beat me to it.

Rest of the code looks ok. I find most of my errors come from simple typos like this, or sometimes failing to fully understand what the lesson wants me to do.


actually, its not the only mistake. if else is used, while this should be else if

and usernumber has no } to close the function


I stand corrected.


Thank you everyone! I should be noticing these things!


Not necessarily, finding and fixing bugs/mistakes is really difficult, you will get better at it over time