© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
rameztayem
let x = 1; const fn = () => console.log(x); // Captures x=1 x = 2; setTimeout(fn, 1000); // Will print 1, not 2
this will print 2 not 1 i have tried it any explaination why?