function foo(x) { if (x === 0) { return 1; } else { if (x === 1) { return 1; } else { return 2; } } } foo(1);