-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if
block
#151
Comments
This is |
Basically yes. Only that the subjectless
vs
|
AFAIK, ternary conditions are also slow because they clone the left side, and it can be costly (ie for long strings). |
While I admit here, in such an expression (assignment) it's far worst to use a switch + IIFE |
Compared to what? Got benchmarks? |
Hacked up a quick jsPerf. Looks like an if-chain is the fastest, followed closely by a ternary chain. Switch is two orders of magnitude slower. |
as:
might make us miss less JS's good ol' cond-exp chain:
The text was updated successfully, but these errors were encountered: