Skip to content

Commit a1bde5b

Browse files
Added link to "Cloning Objects in JavaScript" post
1 parent 746ee4a commit a1bde5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2020-04-19-Transforming JavaScript Arrays using map().markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ At first glance, the above code looks good. But we should observe that we are as
102102

103103
If we print `productsInUSD` array elements to the console, we can see that they are modified and now contain prices in INR. This isn't desired and breaks functionality in other parts of our application.
104104

105-
To avoid this, clone the object before assigning. There are several ways to clone an object, let us use `JSON.parse(JSON.stringify(object))` for this example.
105+
To avoid this, clone the object before assigning. There are [several ways to clone an object]({{ site.baseurl }}{% post_url 2020-05-09-Cloning Objects in JavaScript %}){:target="_blank"}, let us use `JSON.parse(JSON.stringify(object))` for this example.
106106

107107
{% highlight javascript %}
108108

@@ -118,4 +118,4 @@ This doesn't modify the original array and prevents any unintended effects.
118118

119119

120120
[Array.prototype.map()]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
121-
{:target="_blank"}
121+
{:target="_blank"}

0 commit comments

Comments
 (0)