From d328b0c5872e3f9130e2d6ea2a9c61bd4056690f Mon Sep 17 00:00:00 2001 From: Anton Krekotun <36279559+tonchique@users.noreply.github.com> Date: Fri, 16 Oct 2020 16:02:21 +0300 Subject: [PATCH] updated explanation --- content/questions/copying-arrays/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/questions/copying-arrays/index.md b/content/questions/copying-arrays/index.md index 3e37fc19..3668a6c8 100644 --- a/content/questions/copying-arrays/index.md +++ b/content/questions/copying-arrays/index.md @@ -38,4 +38,4 @@ Option A just creates a new reference to the same array. In order to copy all th Keep in mind that methods B and C are making **shallow copies**. This works in the example because all the values are strings. If `mainArray` had objects nested within it, the objects wouldn't be cloned; rather, both the original array and the cloned array would be holding a reference to the same object, so a change to the object in one array would result in a change to the object in the other array. -Remember, JavaScript passes by reference, not value. If you'd like to learn more about arrays and how to create shallow copies (like this example shows), check out the [MDN Array Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) +Remember, objects in JavaScript are passed by reference, not by value. If you'd like to learn more about arrays and how to create shallow copies (like this example shows), check out the [MDN Array Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)