utility to aid in writing functional javascript