Ad
  • Default User Avatar

    Technically, it's more like passing by a const reference and rebinding the reference.

  • Custom User Avatar

    AFAIK functions in every dynamic language always receives a fresh value for primitive types. It only happens in the like of C/C++/C#/Rust via explicitly passed by reference (by &/ref), and they're the complete opposite of a dynamic language.

    It's nothing "extra careful", you should obtain the knowledge to know how they behave so you can put your effort on worrying about things that actually matter instead ;-)

  • Custom User Avatar

    Not for primitive types as they're always passed by value.