DEV Community

Discussion on: How For Loops REALLY work

maisonsmd profile image
maisonsmd • Edited

Nice explaination, but I noticed a typo in this snippet, which confused me for a while:

var i = 8;
function myFunc() {

  var i = 4;
  myFunc(); // > 0

I think you did want to initialize i = 0 in the first line.

devworkssimone profile image
DevWorksSimone • Edited

Please tell me its a typo cause I stop there thinking I didnt get anything

emnudge profile image
EmNudge Author • Edited

I updated the post as soon as he sent this comment. It was in fact a typo and it should be fixed. My deepest apologies.

Thread Thread
devworkssimone profile image

Thanks, I was worried my english needed an improvement!

emnudge profile image
EmNudge Author

Yes, nice catch!