Questions
Tags
Why Object.assign does not clone __proto__?
Why Object.assign does not clone __proto__? Here is the code
https://jsfiddle.net/CitizenOne/ftp4nbzq/21/
Need to clone __proto__
JavaScript
maxie.Mo
asked
June 10th 19 at 15:50
Related questions
1
Swiper Slider and multiple sliders on the page?
1
Why doesn't the script for a modal window?
0
The endless emergence of the prefab position?
1
The pictures and library, the browser keeps?
1
How to insert class characters?
0
Alternatives StringDecoder/StringEncoder?
2
How best to organize the storage of big data retrieved from API?
2
How to stretch the background?
More answers about
"Why Object.assign does not clone __proto__?"
2
answers
marcus.Wel
answered on
June 10th 19 at 15:52
Solution
because `__proto__` or own any of the enumerated property
Damn! Knew it! Although doubted.
- maxie.Mo
commented on June 10th 19 at 15:55
Lenny.Botsfo
answered on
June 10th 19 at 15:54
Solution
Use
Object.create
https://jsfiddle.net/y35b8xt8/
Object.assign
copies only its own enumerable properties.
Find more questions by tags
JavaScript