Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
30 lines (24 loc) · 693 Bytes

File metadata and controls

30 lines (24 loc) · 693 Bytes
Copy raw file
Download raw file
Edit and raw actions

Operators

You can apply mathematic operations to numbers using some basic operators like:

  • Addition: c = a + b
  • Subtraction: c = a - b
  • Multiplication: c = a * b
  • Division: c = a / b

You can use parentheses just like in math to separate and group expressions: c = (a / b) + d

{% exercise %} Create a variable x equal to the sum of a and b divided by c and finally multiplied by d. {% initial %} var a = 2034547; var b = 1.567; var c = 6758.768; var d = 45084;

var x = {% solution %} var a = 2034547; var b = 1.567; var c = 6758.768; var d = 45084;

var x = ((a + b) / c) _ d; {% validation %} assert(x === (((a + b) / c) _ d)); {% endexercise %}

Morty Proxy This is a proxified and sanitized view of the page, visit original site.