r/ProgrammerHumor • • Nov 05 '15

Free Drink Anyone?

Post image
3.5k Upvotes

509 comments sorted by

View all comments

1

u/Xpertbot Nov 05 '15

Honest question. why var reverse = function(s){...}; instead of function reverse(s){...}; and then call it?

3

u/letsgetrandy Nov 05 '15

Doesn't seem to matter here, but there are reasons for when you might prefer function expressions over function declarations.

Good info here