docsearch: TypeError: newCollection[key].push is not a function
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide all the steps to reproduce and a minimal
JSFiddle example or a repository on GitHub that we can npm install
and npm start
.
What is the expected behavior?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (16 by maintainers)
wow, I love your neat solution, it is better than mine.
But according to the hasOwnProperty MDN, we might avoid directly to call newCollection’s hasOwnProperty.
How about this ?
Or
But I think your solution is better, because newCollection won’t change the original hasOwnProperty, and the code is shorter.
I am very glad to submit a PR.
More Information #7853