Pass by Value and Pass by Reference in Javascript

前端 未结 1 1847
-上瘾入骨i
-上瘾入骨i 2020-12-13 05:28

Now that I\'ve been working on Angular2 for almost 3 months, I\'ve encountered a few scenarios which led me to wonder how does this happen ?

In the case of special <

相关标签:
1条回答
  • 2020-12-13 06:08

    Objects and arrays are passed by reference. Primitive values like number, string, boolean are passed by value. A reference to an object is also a primitive type and passed by value like other primitive types, but the object it refers to is still passed by reference.

    This is not Angular or TypeScript specific, just how JavaScript works.

    0 讨论(0)
提交回复
热议问题