Created
August 23, 2015 03:20
-
-
Save chuck0523/80786e913ea20e9ee9ff to your computer and use it in GitHub Desktop.
This file contains 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
# 比較演算子 | |
# 等値演算子は同値演算子に変換される | |
# is isnt なんて書き方もできる | |
# 連結も可能 | |
x = 13 | |
console.log 'ok' if 10 < x < 20 | |
# true -> yes, on | |
# false -> no, off | |
b = true | |
if b == yes then console.log 'yes!' | |
# && -> and | |
# || -> or | |
# ! -> not | |
c = no | |
if b and !c then console.log 'perfect!' | |
# in 要素があるかどうか | |
console.log 'exists' if 5 in [1, 3, 5] | |
# ただし、オブジェクトのプロパティについてはofを使う。 | |
obj = | |
score : 52 | |
console.log 'has point' if 'score' of obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment