r/shittyprogramming • • Apr 12 '16

Easy JavaScript game loop

Post image
277 Upvotes

37 comments sorted by

View all comments

28

u/auxiliary-character Apr 12 '16

I forget, does javascript have tail call recursion?

27

u/MC_Labs15 Apr 12 '16

This particular code will throw an error

9

u/auxiliary-character Apr 12 '16

Yeah, even if javascript has tail call recursion, they're not using return statements at the end.

1

u/ConcernedInScythe May 09 '16

There's an implicit return at the end of the function block, which any decent optimiser should understand.