DEV Community

Discussion on: Project Euler #1 - Multiples of 3 and 5

Collapse
 
gmartigny profile image
Guillaume Martigny

Smallest nitpicking ever: declare i inside the for loop.

for (let i = 0; i < 1000; i++)

It will prevent it from leaking outside the loop.

Collapse
 
jacobmgevans profile image
Jacob Evans

I wouldn't even call that nitpicking, that is solid best practice advice to avoid memory leaks.