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
| number = 32 | |
| approve = on | |
| number = -42 if approve | |
| twice = (x) -> x * 2 | |
| number = twice 3 |
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
| var number = 32; | |
| var approve = true; | |
| if (opposite) { | |
| number = - 42; | |
| } | |
| twice = function (x) { | |
| return x * 2; | |
| } |
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 — остаток от деления |
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
| obj1.x = 666 | |
| a = obj2.y | |
| obj3.width = obj1.width |
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
| obj = new Layer | |
| x: 225 | |
| y: 517 | |
| width: 300 | |
| height: 300 |
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
| var num = 14; | |
| if (num > 16) { | |
| console.log("Больше, чем 16."); | |
| } else { | |
| console.log("Меньше, чем 16, или равно."); | |
| } | |
| // => Меньше, чем 16, или равно. |
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
| num = 10 | |
| if num > 20 | |
| print "Yes" | |
| else | |
| print "No" | |
| # => No |
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
| # Больше и меньше | |
| a > b | |
| a < b | |
| # Равно и неравно | |
| a is b | |
| a isnt b | |
| # Рассмотрим пример: | |
| a = true |
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
| # Логические "и", "или", "не" | |
| a and b | |
| a or b | |
| a not b | |
| # Рассмотрим пример: | |
| a = b = c = true | |
| d = false | |
| if a is b and c isnt d |
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
| // Осторожно! JavaScript | |
| // Цикл for | |
| for (var i = 0; i < 10; i++) { | |
| console.log(i); | |
| } | |
| // Цикл while | |
| var j = 0; | |
| while (j < 10) { | |
| j += 1; |
OlderNewer