Practice
JavaScriptData StructuresReactConcepts
Sign in
← Back to problems

Partial Application

A Closer Look at Functionsmedium

Course · Section 10: A Closer Look at Functions · Lecture 141: The bind Method

Implement `partialGreet(greeting, names)` that fixes the greeting on a `greet(greeting, name)` function and maps it over `names`.

Sample tests

Input: partialGreet("Hi", ["A","B"])
Output: ["Hi A","Hi B"]
Input: partialGreet("Hey", ["X"])
Output: ["Hey X"]

+ 1 hidden test run on Submit.

Hints

Common pitfalls
  • Passing names positionally into bind instead of mapping.
Approach & explanation (try first)

Partial application fixes the greeting so the mapped function only needs a name.

Loading...
⌘/Ctrl + Enter

Run your code to see results.