diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-numbers-booleans-and-the-math-object/673271884bf678d8b9c64f56.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-numbers-booleans-and-the-math-object/673271884bf678d8b9c64f56.md index 6cc8443854c..a9f1a0d0334 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-numbers-booleans-and-the-math-object/673271884bf678d8b9c64f56.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-numbers-booleans-and-the-math-object/673271884bf678d8b9c64f56.md @@ -14,35 +14,76 @@ Watch the lecture video and answer the questions below. ## --text-- -How can you check if a number is even using the `modulus` operator in JavaScript? +Which of the following operators should you use to subtract one number from another? ## --answers-- -Use the `modulus` operator and check if the remainder is equal to `0` using strict equality (`===`). - ---- - -Use the `modulus` operator and check if the remainder is greater than `1`. +`+` ### --feedback-- -Consider what remainder an even number gives when divided by `2`. +Think about the symbol typically used for subtraction. --- -Use the `modulus` operator and ignore the remainder. - -### --feedback-- - -Consider what remainder an even number gives when divided by `2`. +`-` --- -Use the `modulus` operator and check if the remainder is equal to 1. +`*` ### --feedback-- -Consider what remainder an even number gives when divided by `2`. +Think about the symbol typically used for subtraction. + +--- + +`/` + +### --feedback-- + +Think about the symbol typically used for subtraction. + +## --video-solution-- + +2 + +## --text-- + +What’s the output of the following code? + +```js +const result = 4 / 0; +console.log(result); +``` + +## --answers-- + +`Infinity` + +--- + +`4` + +### --feedback-- + +Recall the special value JavaScript returns when you divide by zero. + +--- + +`1` + +### --feedback-- + +Recall the special value JavaScript returns when you divide by zero. + +--- + +`16` + +### --feedback-- + +Recall the special value JavaScript returns when you divide by zero. ## --video-solution-- @@ -50,71 +91,40 @@ Consider what remainder an even number gives when divided by `2`. ## --text-- -Which of these statements best describes operator precedence in JavaScript? +What’s the output of the following code? + +```js +const remainder = 5 % 3; +console.log(remainder); +``` ## --answers-- -Addition and subtraction have the highest precedence. +`15` ### --feedback-- -Consider which operations are executed first in a mathematical expression. +Remember that `%` is the remainder operator, so another way to think of the equation is, after `3` goes into `5` once, what’s left? --- -Exponentiation has the highest precedence, followed by multiplication, division, and remainder. +`2` --- -Multiplication and division have lower precedence than addition and subtraction. +`3` ### --feedback-- -Consider which operations are executed first in a mathematical expression. +Remember that `%` is the remainder operator, so another way to think of the equation is, after `3` goes into `5` once, what’s left? --- -All operators have the same precedence. +`1.6666666666666667` ### --feedback-- -Consider which operations are executed first in a mathematical expression. - -## --video-solution-- - -2 - -## --text-- - -How do you use the subtraction operator in JavaScript to find the difference between two numbers? - -## --answers-- - -Use the plus sign (`+`) to subtract numbers. - -### --feedback-- - -Think about the symbol typically used for subtraction. - ---- - -Use the minus sign (`-`) to subtract a smaller number from a bigger number. - ---- - -Use the multiplication sign (`*`) to perform subtraction. - -### --feedback-- - -Think about the symbol typically used for subtraction. - ---- - -Use the division sign (`/`) to find the difference. - -### --feedback-- - -Think about the symbol typically used for subtraction. +Remember that `%` is the remainder operator, so another way to think of the equation is, after `3` goes into `5` once, what’s left? ## --video-solution--