Number Expressions

Numbers
πŸ‘¨β€πŸ’Ό Numbers are essential for any kind of calculation. Let's explore arithmetic in JavaScript.
JavaScript supports all the standard math operators:
  • + addition
  • - subtraction
  • * multiplication
  • / division
console.log(10 + 5) // 15
console.log(10 - 3) // 7
console.log(4 * 3) // 12
console.log(20 / 4) // 5
πŸ“œ There are many more operators in JavaScript beyond these basics! You can find a complete list in the MDN Expressions and Operators guide.
🐨 Open
index.ts
and complete the following tasks:
  1. Log the result of adding 25 and 17
  2. Log the result of multiplying 8 by 6
  3. Log the result of dividing 100 by 4
  4. Log the result of a more complex expression: (10 + 5) * 2
πŸ’° You can use parentheses to control the order of operations, just like in regular math!

Please set the playground first

Loading "Number Expressions"
Loading "Number Expressions"