It turns out there are a lot of different ways to duplicate objects Photo by James Orr on Unsplash In JavaScript, a variable can store two types of data: Primitive Reference When we copy primitive values, only the value will be copied. var a = 10; var b = a; console.log(a, b); // 10, 10 b …
Continue reading “Different Ways to Duplicate Objects in JavaScript”