13. Comparisons


SyntaxError: missing ) after argument list

console.log ("hi".length === 2);
console.log("nice".length < 5);
console.log("guy".length !== 4);
console.log("hello".length >= 5);


Please include a link to the exercise so we can test your code. Thanks.




We should not change the code, only insert the appropriate comparison operator. Here is the set up:

// Here is an example of using the greater than (>) operator.
console.log(15 > 4); // 15 > 4 evaluates to true, so true is printed.

// Fill in with >, <, === so that the following print out true:
console.log("Xiao Hui".length  122);
console.log("Goody Donaldson".length  8);
console.log(8*2  16);

Reset the code so you get this to work with.


Oh i thought it wanted me to do a code myself, thanks for that


We will get a chance to be creative later in the course but for the time being, stay as close to the instructions as possible for the best results. A lot of the lessons are quite strict that way. Use the provided code, strings and values given. Once you complete the course, come back to the beginning and review. That will be a time to experiment and try out your ideas.


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