functional javascript pt2