2coffee.dev

  • Series
    1 Month Learning Rust - Closure
    • 🏷️rust

    1 Month Learning Rust - Closure

    In JavaScript, a Closure refers to a function that can remember and access variables from its outer scope, even after that outer scope has finished executing. In short, when a function is defined inside another function and accesses variables from the parent function, a closure is created. In Rust, closures are similar to those in JavaScript; they can remember and use variables from the outer scope where they are defined. However, closures in Rust are much more complex than in JavaScript...

    🕝2 days ago