Return function shortcut:
// Before function foo() { bar(); baz(); return 1; } // After function foo() { return bar(), baz(), 1; }
Conditional shortcut variants:
// Before return a ? a : b; // After return a || b;
// Before return a ? b : c; // After return a && b || c;
// Before return a && b ? c : d; // After return a && b && c || d;
// Before if (a && b) { c = d; } // After a && b && (c = d);
// Before if (a) { b = c; d = e; } else { b = e; } return f; // After return a && ((b = c), (d = e)) || (b = e), f;
Nice!
Interesting. Thank you for sharing that.
Wow π²
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Return function shortcut:
Conditional shortcut variants:
Nice!
Interesting.
Thank you for sharing that.
Wow π²