Skip to content

You won’t believe this one weird way to rewrite closures.

Notifications You must be signed in to change notification settings

nybblr/closures

Repository files navigation

This JS repo will restore your faith in closures.

Rewrite closures and scoping rules from scratch. Entirely in JavaScript. Using prototypal inheritance, some clever hat-tips from graphics programming, amnesic function bodies, and this one weird global variable.

Slides are up on Speaker Deck.

Convert code to closure-less equivalent

To convert some regular JavaScript to the closure-less version demoed, go to https://nybblr.github.io/closures/ and drop in some code.

Note that it is extremely limited and won't handle any edge cases (e.g. multiple var declarations per line, function declarations, etc.)

About

You won’t believe this one weird way to rewrite closures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages