News for hackers. Stuff that matters.
Re:Currying in JavaScript by fendy3002 on Sunday September 19, 2021 @07:42AM (#28583549)
Nice catch. Rather than date the author should've pass the DEBUG constant instead.

Or a function that return new date, but it'll make things complicated.

Re:Currying in JavaScript by mjbrusso on Sunday September 19, 2021 @10:56AM (#28584815)
However , to pass a constant I could use default parameter value.
Re:Currying in JavaScript by fendy3002 on Sunday September 19, 2021 @08:09PM (#28589144)
It's the function definition that's responsible for defining default parameter.

It's the function caller that's responsible for that parameter with partial application / currying / closure.

It doesn't matter if you develop both, but if you use a library you'll need partial application to define default parameter.