Operators Worksheet
Question 1
What are the comparison operators used for?
Comparison operators are used to compare two values and see if they are related in a certain way.
They give a result of either True or False.
Question 2
Explain the difference between the logical AND operator (&&) and the logical OR operator (||).
Logical AND (&&): This operator returns True only if both conditions are true.
Logical OR (||): This operator returns True if at least one of the conditions is true.
Logical OR (||): This operator returns True if at least one of the conditions is true.
Question 3
Which operator would you use to find the remainder from dividing 2 numbers.
The modulus operator (%).
Question 4
Which operator would you use if you wanted to find out if two values were NOT equal?
The not equal to operator (!=).
Coding Problems - See the 'script' tag below this h3 tag. You will have to write some JavaScript code in it.
Always test your work! Check the console log to make sure there are no errors.