Java Script


We saw basic math before. The basic math symbols we learned in school work here. Even the order in which the computer understands the math is the same as in school!


( ): control order of operations
* and /: multiplication and division
- and +: subtraction and addition

100/10 evaluates to 10
"Jane".length + 5 evaluates to 9
5*(3+1) evaluates to 20
Complete the missing bits of code to construct the if / else statement. Make the condition evaluate to true.
Finish the else statement by printing out the string "Error Error Error" to the console.
There is a lot of left out syntax. The if keyword and the { } after the else keyword are all left out.

Make sure not to delete any of the provided code. It could cause your code to fail!

Oops, try again. It looks like 'Jon' on line 5 was not defined before it was used. This means either you need to define it, 'Jon' is spelled incorrectly or you need quotes around 'Jon'.

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


Please ask questions instead of copying the exercise


Look I have always done thisand if you can solve it for me please do and if you are unhappy for me to do this then why dont you complain to sombody else becasue I dont need these complaints ok. all I ask for is a bit of help then I get you commenting a complaint.


There's nothing to reply to, you're not asking for anything, you're not explaining what the trouble is.

It's a bit like grabbing your homework and putting it in front of someone while saying nothing -- and expecting them to do something with it


ok look im sorry just little bit annoyed why it wont work if you can just bare with me whie i try to write an explanation


basicall the highlighted section is what i had to do and the section bellow the // notes is my code and it tells me to write those and that is what i did then it told me when i pressed the save and run to...


There's an example at the bottom of the instructions, which suggests how to do what they're asking for, it doesn't quite match what you're doing



oh XD sorry just sin ur reply just gonna take another look m8


thanks for being patient


What they want you to do is to use .substring(). For example, for the first string you should use


Remember that the 0 stands for the first character in the substring.


console.log("Melbourne".substring(0, 16) );
Melbourne needs to be in Melbourne is great and im not sure where I went wrong



You need the full string. not just the words. Use the .substring() method to get the words.


They want you to use the substring method to print out the first 12 characters of "Melbourne is great".


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.