ESLint error no-unneeded-ternary
// Bad
foo(bar ? bar : 1);
// Good
foo(bar || 1);
This is how they say in Es-lint
You don't need a ternary when a simple val || defaultVal
will do.
// Bad
foo(bar ? bar : 1);
// Good
foo(bar || 1);
This is how they say in Es-lint
You don't need a ternary when a simple val || defaultVal
will do.