Closures in JS ๐Ÿ”ฅ | Namaste JavaScript Episode 10



Closures in JavaScript is the most important topic for interviews. Even many senior frontend developers don’t understand this …

49 Comments

  1. ์ง€๋ ธ์Šต๋‹ˆ๋‹ค ์ง„์งœ ์ด์ •๋„๋กœ ๊นจ์šฐ์ณค๋‹ค๋Š” ๋А๋‚Œ์„ ๋ฐ›์€ ๊ฒƒ์€ ์ฒ˜์Œ์ž…๋‹ˆ๋‹ค ์†์ด ์‹œ์›ํ•˜๋„ค์š” ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

  2. Akshay, I am beginner and I have a doubt at https://youtu.be/qikxEIxsXco?t=882 .
    Primitive datatypes are passed by value so when variable a is reassigned wouldn't it give an error? Am I missing something here?

    I know that first it was defined by let keyword and then a was directly assigned value 100. Does it mean it has become a global variable?

    EDIT: Just remembered, functions are passed by reference. So a variable defined inside it will also be passed by reference?

    EDIT2: I am freaking out after going through pass reference and pass by value on geeksforgeeks. Every thing messed up in my head. Please help.

  3. Thank-you Akshay. I love watching your videos. You are first and last my favourite instructor of js. Please keep making videos on js advance. I was watching my instructor video around 3 hours but didn't understand not even a single line but when I learnt from you. I understood easily.

    Kindly cover
    oops
    LLD
    Promise
    Fetch api these kind of topics too. So that we all be good at programing like you.๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™๐Ÿ™Œ๐Ÿ™Œ๐Ÿ™Œ๐Ÿ™Œ๐Ÿ™Œโค๏ธโค๏ธโค๏ธ๐ŸŽ‰

  4. Thank you so much for your videos , like first time in my life I am understanding the hoisting and closure and lexical environment any many more things. Thanks

  5. Dear Akshay put couple of lemon drops into your green tea and the taste won't be disgusted you again and thanks for this another great video!

  6. People say communication is the key trait of growth and everything and I could see it today in this session! need to work on it bruh!

  7. Thanks Akshay for another great video in this series.
    I am really thankful to you.

    Here is an example of a function which can be called once only,

    function relay() {
    let relayed = false;

    return function selfDestructibleMessage() {
    // Message is already relayed then return an error.
    if (relayed) {
    return 'Message destroyed!';
    }

    // Message will be returned so we set relayed to true.
    relayed = true;

    return 'Your mission, should you choose to accept it, (secret message ahead)…';
    }
    }

    const relaySecretMessage = relay();

    console.log(relaySecretMessage()); // this relays the message
    console.log(relaySecretMessage()); // this returns an error message
    console.log(relaySecretMessage()); // this returns an error message
    console.log(relaySecretMessage()); // this returns an error message

  8. I think this is the first time ive heard you curse, teacher Akshay ๐Ÿ˜‚ i love it! Thank you for being an amazing teacher

  9. Bahut jgh pdha..mdn v dekha tha utne acche se ni smjh aaya but yha full clear hua bhut acche se . Ab refrence aapka v lunga js related.dhywaad aur bhgwaan aapko aise hi aage badhate aur khus rakhe โค๏ธ

  10. Hi Akshay can expect unit testing videos? Kind of enzyme and jest and you are known your videos are helping me in my project. Thank you for such a fresh content.

Leave a Reply

© 2023 53GB