Last active
August 29, 2015 14:26
-
-
Save antonkartashov/47ecea8b338c719946c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Сложение, вычитание, умножение, деление | |
10 + 10 | |
30 - 10 | |
2 * 10 | |
40 / 2 | |
# => 20 | |
# Деление с остатком | |
10 % 3 | |
# = > 1 — остаток от деления | |
# Скобки и порядок вычислений | |
150 - 5 * 20 | |
# => 50 | |
(150 - 5) * 20 | |
# => 2900 | |
# Цифры в кавычках воспринимаются как символы, а не числа | |
'50' + '50' | |
# => '5050' | |
# Абсолютное значение числа (без учета знака минуса) | |
Math.abs(-20) | |
# => 20 | |
# Генератор случайных чисел от 0 до 1.0 | |
Math.random() | |
# => 0.3057850990444422 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment