Skip to main content

If declarations in conditionals were possible ( @span tc39 proposal being discussed right now!) what would you expect this to log?

let foo = 1;
if (let foo = 0) { console.log(foo) }
else { console.log(foo) }

Poll Open
2 days left 128 votes Federated

1

1

(34) 27%

0

0

(60) 47%

undefined

undefined

(5) 4%

Nothing, it throws

Nothing, it throws

(29) 23%
Sign in to vote
15 Replies
·
0 Boosts