---
title: "Discussion on \"Have you seen this kind of function?\" | Hashnode"
description: "Discussion on \"Have you seen this kind of function?\". Definitely, you must have seen it or something similar. These kinds of functions are called \"High-order Functions\" in JavaScript.\nWhat are high Order Functions?\n\nThese are functions that operate on other functions, either by taking them as arguments ..."
url: "https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Have you seen this kind of function?](https://theodorejs.hashnode.dev/have-you-seen-this-kind-of-function?utm_source=hashnode&utm_medium=feed)

Definitely, you must have seen it or something similar. These kinds of functions are called "High-order Functions" in JavaScript. What are high Order Functions? These are functions that operate on other functions, either by taking them as arguments ...

Jan 10, 2021 · 4 min read · theodorejs.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#functions](https://hashnode.com/tag/functions)

## Written by

[Theodore Kelechukwu Onyejiaku](https://hashnode.com/@JavaScriptar)

@JavaScriptar

  
[View profile](https://hashnode.com/@JavaScriptar)

Fullstack MERN Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Osinachi Chukwujama](https://hashnode.com/@Vicradon)

[Jan 12, 2021](https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605/comment/5ffdd3e0c162d710c9b12dd3)

Thank you for sharing your knowledge.

I still haven't understood why this currying approach is considered. I think it's easier to destructure the parameters like this

```
const checkBankDetails({
  username,
  userNameRegex, 
  acctNumber,
  acctNumberRegex
}) => {}
```

It gives more flexibility on how the function should be called. But apart from that, thank you for writing this blog.

[Theodore Kelechukwu Onyejiaku](https://hashnode.com/@JavaScriptar)

[Jan 12, 2021](https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605/comment/5ffdd3e0c162d710c9b12dd3#reply-5ffe122ab00f7510ee95874e)

Thanks Osinachi. I appreciate your kind words. The purpose of the article was to create a confident Impression on seeing such a high-other-function or curried function. To your question, I would say, we don't need destructuring in this context. Especially when we do React by using the "connect". Eg: connect(mapToStateProps)(AnyComponent).

In this case, we have used a high-other function in such a way that closure is established between the "mapStateToProps" and "AnyComponent".

Please let me know if I answered your question.

Thanks again friend.

[Osinachi Chukwujama](https://hashnode.com/@Vicradon)

[Jan 12, 2021](https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605/comment/5ffdd3e0c162d710c9b12dd3#reply-5ffe1400b00f7510ee958753)

[Theodore Kelechukwu Onyejiaku](https://hashnode.com/@JavaScriptar)

Oh yeah

Currying is useful when the inner function is defined by the user.
