Understanding Deep vs Shallow Copying in JavaScript

Richard Oliver Bray
3 min readJul 31, 2023
humanoids leading a revolution dune style

JavaScript, like most programming languages, has mechanisms for creating duplicate values or copying information. In this article we’re going to look at two key ways of making JavaScript copies: Deep and Shallow copying.

Copying a variable with a primitive data type like a string or number is fairly straight forward, but it can get a bit complex when it comes to copying…

--

--

Richard Oliver Bray

Co-founder of orva.studio. Building digital products and teaching others to do the same. Saved by grace.