higher order javascript library