Real curry behavior in JavaScript