Here it is ¯\_(ツ)_/¯ I'm looking forward for feedbacks
let sum = 0, i = 0 for (i = 0; i < 1000; i++) { if (i % 3 === 0 || i % 5 === 0) sum += i } console.log('The sum is %d', sum)
Smallest nitpicking ever: declare i inside the for loop.
i
for
for (let i = 0; i < 1000; i++)
It will prevent it from leaking outside the loop.
I wouldn't even call that nitpicking, that is solid best practice advice to avoid memory leaks.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here it is ¯\_(ツ)_/¯
I'm looking forward for feedbacks
Smallest nitpicking ever: declare
i
inside thefor
loop.It will prevent it from leaking outside the loop.
I wouldn't even call that nitpicking, that is solid best practice advice to avoid memory leaks.