Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 282 Bytes

File metadata and controls

5 lines (3 loc) · 282 Bytes

Js fundamentals reference vs copy

The most common pitfall in js is probably due to not understanding the difference between primitive types and objects.

TL:DR; arrays and objects are referenced, to make copies use either of the methods slice,concat,[...],Assign,{...}