functional javascript workshop solution