cloneArray
Creates a clone of an array.
This function receives an array and returns a clone of that array.
Why this is useful? Well, Javascript copies by reference. So if you "copy" an array like this;
Your variable b
would only be referencing the variable a
. This basically means if a is updated, b
gets updated too.
This function copies by value and not by reference.
Last updated