Created
February 29, 2016 00:04
-
-
Save zootella/76d09ad23237c9be6909 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
//1. native operators, best looking but depends on primitive types or operator overloading | |
if (1 + 5 - 2 <= 9) return; | |
//2. methods, correct java-inspired design employed by most modules | |
if (int(1).add(5).subtract(2).lessThanOrEqualTo(9)) return; | |
//3. first custom design, works alongside 2 | |
if (int(1)._("+", 5)._("-", 2)._("<=", 9)) return; | |
//4. current design, replaces others | |
if (int(1, "+", 5, "-", 2, "<=", 9)) return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function int() at https://github.com/zootella/node/blob/master/measure.js#L374