1 min readApr 13, 2020
Hey Nathaniel Lee, thanks so much for stopping by and for your excellent comment! You have great attention to detail!!!
That’s a great catch! You only need to check whether we’re working with an object in one place or the other, not both.
Here’s a comparison of both strategies:
I updated the article to use the If Statement version —
what you suggested for Line 15: outObject[key] = deepCopyFunction(value)
— since it’s more robust and a little clearer. Thanks again!