Lesson 19


#1

("Jon".length * 2 / (2+1) ===2 )
if{
console.log("The answer makes sense!");
}
else{console.log ("Error Error Error");
}

Does anyone know where i screwed up with my code


#2

console.log("January".substring(0,3) );
console.log("Melbourne is great".substring(0,9) );
console.log("Hamburgers".substring(3,10) );

this one is confusing me as well. its lesson 23


#3

Consider the position of your if. If what? What do you really want to decide with that if?


#4

Hi. The code you are asked to fix in this exercise is

 ("Jon".length * 2 / (2+1) === )
{
    console.log("The answer makes sense!");
} 
else

Think back to the syntax of Lesson 14 Decisions, decisions
The syntax for an if statement is

if( some condition ) {
    some statement that runs if the condition is true
}
else {
    some code that runs if the condition is false
}

So with that in mind your code should look like this

if (some condition that compares if 2 === 2 ) {
    console.log("The answer makes sense!");
} 
else {
    console.log ("Error Error Error");
}

Hope this helps.