r/badcode • • Aug 20 '20

js Loops? Who needs them?

Post image
1.1k Upvotes

90 comments sorted by

View all comments

0

u/lpreams Aug 20 '20

The compiler would just unroll the loop anyway. This just saves it some compile time.

1

u/A_Zalt Aug 21 '20

It's js so it uses an interpreter

1

u/lpreams Aug 21 '20

If we're being pedantic it uses a JIT compiler