Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question 29: check for null #59

Closed
vibl opened this issue Oct 23, 2018 · 1 comment
Closed

Question 29: check for null #59

vibl opened this issue Oct 23, 2018 · 1 comment

Comments

@vibl
Copy link

vibl commented Oct 23, 2018

In "Question 29. Write a function called deepClone which takes an object and creates a object copy of it.", the deepClone function should check for a null value:

if( typeof object[key] === 'object' && object[key] !== null )...

What's more, we usually want to also check for hasOwnProperty().

@ganqqwerty
Copy link
Owner

fixed check for null. About hasownproperty I'm not that sure...

ganqqwerty added a commit that referenced this issue Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants