Comment

Comment by williamdclt

No. Object are passed by value. Exact same example apply:

    let a = {key: 'a'};
    
    function foo( a ) {
      a = {otherKey: 'b'};
    }
    
    foo( a );
    
    console.log( a ); // {key: 'a'}
parent williamdclt 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton