javascriptの参照と値

 javascriptの参照と値

javascriptの参照渡しと値渡しについて

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

27 slides
  1. Pass by reference const A = {}; const B =

    A; B.x = 1; console.log(A); // { x: 1 }
  2. Pass by value const A = 1; const B =

    A; B++; console.log(A); // 1
  3. String behave like value let A = 'a'; let B

    = A; A += 'b' // Create new instance and assign to self. console.log(A); // 'ab'; console.log(B); // 'a;