javascript: collapse noop conditionals