Operators Worksheet

Question 1

What are the comparison operators used for?

There used to compare 2 different values and rationships between them

Question 2

Explain the difference between the logical AND operator (&&) and the logical OR operator (||).

& - requires both sides to be true to come as true || - requires one side to be true to come out as true

Question 3

Which operator would you use to find the remainder from dividing 2 numbers.

You would use the modulus operator %

Question 4

Which operator would you use if you wanted to find out if two values were NOT equal?

you would use !=

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.