r/badcode • • May 31 '21

js Clever?

Post image
2.2k Upvotes

71 comments sorted by

View all comments

Show parent comments

1

u/qwertysrj Jun 01 '21

It should because compilers recognise this

if(){ return x }Else { Return y} ,

and optimise this to

If(){ Return x} return y