Operators Worksheet
Question 1
What are the comparison operators used for?
They are used to evaluate an input of data and direct a user of a webpage to a respective codeblock
Question 2
Explain the difference between the logical AND operator (&&) and the logical OR operator (||).
The logical operator && will reqire a user to match more than 1 predetermined value, while the logical oeprator
|| will require a user to meet 1 value of multiple given.
|| will require a user to meet 1 value of multiple given.
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 inequality 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.