-
Notifications
You must be signed in to change notification settings - Fork 6
Equality
Shane Brinkman-Davis Delamore edited this page Mar 29, 2018
·
3 revisions
Related: Semantics
The normal JavaScript equality operator is highly unpredictable and can have a significant performance hit. In JavaScript, '123' == 123
is true, and costly to compute.
Thankfully, JavaScript also has a high performance, easy-to-understand ===
operator. So CaffeineScript simply translates any '==' to '===':
# CaffeineScript:
a == b
# translates to JavaScript: a === b
a != b
# translates to JavaScript: a !== b
However, JavaScript does NOT have an equivalent set of inequality operators.
CaffeineScript has plans to fix this, though it is more challenging. See: Operator Overloading
- Home
- Get Started
- Benefits
- Highlights
- Productivity by Design
- CaffeineScript Design
- What is CaffeineScript Good For?
- Get the most out of JavaScript
- Language Comparison
- CHANGELOG
- Blocks Instead of Brackets
- Binary Line-Starts
- Everything Returns a Value
- Streamlined Modules
- Scopes and Variables
- Optional Commas
- Semantics
- Ambiguities