Comment

Comment by kevincennis

JavaScript is absolutely not pass by reference.

    let a = 1;
    
    function foo( a ) {
      a = 2;
    }
    
    foo( a );
    
    console.log( a ); // 1
parent kevincennis 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton