functional js curry