2. 实现支持placeholder的curry()

中等难度  -通过 / -执行

该问题紧接着1. 实现curry()

请实现一个支持placeholder的curry(),可以像这样使用。

const  join = (a, b, c) => {
   return `${a}_${b}_${c}`
}

const curriedJoin = curry(join)
const _ = curry.placeholder

curriedJoin(1, 2, 3) // '1_2_3'

curriedJoin(_, 2)(1, 3) // '1_2_3'

curriedJoin(_, _, _)(1)(_, 3)(2) // '1_2_3'

阅读更多

https://javascript.info/currying-partials

https://lodash.com/docs/4.17.15#curry

https://github.com/planttheidea/curriable

相关题目

1. 实现curry()

相关题目列表

lodash

注意特例。

(1)
(193)