S
S
shapovaloff2018-02-10 21:15:08
JavaScript
shapovaloff, 2018-02-10 21:15:08

How to write a js function in the format "let sum = plus(2)(3)"?

Hello! There is a task: "Write your own version of the plus function that will satisfy the code below: 1) The question is, why separate two parameters plus (2) (3), if these parameters can be passed immediately in one bracket plus (2,3) 2) How to implement it in general?
let sum = plus(2)(3); // 5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Varyukhin, 2018-02-10
@shapovaloff

This function returns a reference to itself.
Here is a great lesson.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question