---
title: "Mansoor Ameen (@mansoorameen) | Hashnode"
description: "Self-taught coder | Front-end developer. Read the latest articles by Mansoor Ameen on Hashnode."
url: "https://hashnode.com/@mansoorameen"
---

@mansoorameen

# Mansoor Ameen

@mansoorameen · Joined June 2021

Self-taught coder | Front-end developer

[Website](https://mansoorameen.netlify.app/)

## Comments

[Paarth Bajaj Glad to be of some help :)](https://hashnode.com/posts/understanding-closures-and-lexical-environment/60f78c673e181324dac717c6/comment/6103efbf9036db5b3513c69f#reply-6104184e805a765b0887702c)

Reply · Article · Jul 30, 2021 · [Understanding "Closures" and Lexical Environment](https://hashnode.com/posts/understanding-closures-and-lexical-environment/60f78c673e181324dac717c6)

[Paarth Bajaj Functions form closures. Here each function forms a closure, and that's why they can access var num.](https://hashnode.com/posts/understanding-closures-and-lexical-environment/60f78c673e181324dac717c6/comment/6103efbf9036db5b3513c69f#reply-61040d1e805a765b08876dee)

Reply · Article · Jul 30, 2021 · [Understanding "Closures" and Lexical Environment](https://hashnode.com/posts/understanding-closures-and-lexical-environment/60f78c673e181324dac717c6)

[If you see the code mentioned in this post on the top, that itself is a closure(the function b has access to var num that is outside the function b, which is also its lexical environment). What I meant by "combine all those functions (not one, but all)" is that, if you had many nested functions here like: function a() { var num = 10; function b() { var newNum = num + 5; console.log(newNum) function c() { console.log(num) function d() { console.log(num) } } } } each of these functions has its own lexical environment, right? And this whole code is called closure\[ combine all the lexical environments, you get a closure\]. As it is closure, all these functions will have access to var num, and also any variables declared in the global scope. I think that last line in my post is confusing. Will update it.](https://hashnode.com/posts/understanding-closures-and-lexical-environment/60f78c673e181324dac717c6/comment/6103efbf9036db5b3513c69f#reply-6103fac3805a765b08876ba2)

Reply · Article · Jul 30, 2021 · [Understanding "Closures" and Lexical Environment](https://hashnode.com/posts/understanding-closures-and-lexical-environment/60f78c673e181324dac717c6)

[Thank you! So happy and honoured to be on this list😍 Congrats to all the amazing writers🎉](https://hashnode.com/posts/winners-of-june-coffee-giveaway/60eb2dc6c551f16b0f84e911/comment/60ebc1806d962b01bded4dbe)

Comment · Article · Jul 12, 2021 · [Winners of June Coffee Giveaway](https://hashnode.com/posts/winners-of-june-coffee-giveaway/60eb2dc6c551f16b0f84e911)

[Glad this helped you!](https://hashnode.com/posts/function-currying-explained/60e55d8f4aacd6304824640d/comment/60e758c93dc33f032e23bffd#reply-60e90aa7c551f16b0f846f01)

Reply · Article · Jul 10, 2021 · [Function Currying Explained](https://hashnode.com/posts/function-currying-explained/60e55d8f4aacd6304824640d)

[Haha nice GIF! Also thanks for pointing out the sample code format. Fixed it.](https://hashnode.com/posts/function-currying-explained/60e55d8f4aacd6304824640d/comment/60e69e8fd534931b99a4fce5#reply-60e6a9ebc32fbd1b73720b06)

Reply · Article · Jul 8, 2021 · [Function Currying Explained](https://hashnode.com/posts/function-currying-explained/60e55d8f4aacd6304824640d)

[Thank you! Loving these GIFs :)](https://hashnode.com/posts/function-currying-explained/60e55d8f4aacd6304824640d/comment/60e690b9d534931b99a4fb59#reply-60e6a989d534931b99a4fdc6)

Reply · Article · Jul 8, 2021 · [Function Currying Explained](https://hashnode.com/posts/function-currying-explained/60e55d8f4aacd6304824640d)
