Tim Hanke
Hanke Town

Hanke Town

How Do I Copy an Array in JavaScript?

Mar 24, 20223 min read

In JavaScript, when you assign a string or number variable to a new variable you get two copies of the same string or number. You probably wouldn't expect anything you do to one of those variables afterward to affect the other variable. But, if you ...

How Do I Copy an Array in JavaScript?