Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptclosures and memory retentionSingle-choice MCQ3 views

What does this code log?

const fns = [];\nfor (let i of [1,2,3]) fns.push(() => i);\nconsole.log(fns[0](), fns[1](), fns[2]());