---
title: "Comment by Osinachi Chukwujama  on \"Have you seen this kind of function?\" | Hashnode"
description: "Thank you for sharing your knowledge. I still haven&#39;t understood why this currying approach is considered. I think it&#39;s easier to destructure the parame"
url: "https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605/comment/5ffdd3e0c162d710c9b12dd3"
---

[Discussion](https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605)

Comment [Have you seen this kind of function?](https://hashnode.com/posts/have-you-seen-this-kind-of-function/5ffae5caaa5c467fe1559605)

[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.

[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.
