Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at cf.Objective() 2014 (Bloomington, MN) with: Dave Ferguson and Simon Free and Tim Cunningham and Jason Dean
Ben Nadel at cf.Objective() 2014 (Bloomington, MN) with: Dave Ferguson@dfgrumpy ) , Simon Free@simonfree ) , Tim Cunningham@TimCunningham71 ) , and Jason Dean@JasonPDean )

Ampersandre

Member since May 6, 2010

Recent Blog Comments By Ampersandre

  • Javascript Function() Constructor Does Not Create A Closure

    Posted on May 6, 2010 at 3:56 AM

    Your function creation still creates a closure. Right before the call to testScope(), assign a different value to the scope variable. It will still print "window" to the console. The problem is just that the creation of the new Function uses the global variable instead of the local variable. I'm no... read more »