Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • Parameters are "assigned" when functions are called. Calling greaterThan with the parameter 10 assigns it to n. greaterThan returns a function "enclosing" n--it remains 10. The returned function is called with its own parameter, assigned to m. The "magic" you may be missing are closures (searchable term). Commented Jan 22, 2023 at 15:21

lang-js