Dr. Derek Austin 🥳
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!

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

No responses yet