Script and example code from FunctionalJS Dojo