However, there are some major differences:
:can optionally be used for assignment, instead of
=. On one hand this is nice, as it unifies JSON syntax and normal language syntax. On the other, it feels really, really weird, and makes it harder to see when you’re looking at an object literal vs. normal code.
varkeyword, scoping is automatic.
functionkeyword, functions look more like Python lambdas.
- Significant whitespace for scopes, a la Python.
Some of my favorite features:
- Tail conditionals:
number = -42 if opposite_day
lunch = eat(food) for food in foods
- Inheritance and a
- Multiline strings