It’s not the value that i holds which is passed, in closures it holds the reference of i. So the last value held by i is 5 and that’s what stored in its reference.

A UI /UX Designer and JS Enthusiast, with a passion for travelling and writing.

Love podcasts or audiobooks? Learn on the go with our new app.