why deepClone do not use clone but obj
henrycjchen opened this issue · comments
Henry commented
In the snippets/deepClone
, there is a case to return Array.from(obj)
, which make the clone object useless, is it correct to do so?
Rohan Prabhu commented
I believe Array.isArray(obj) checks if obj is of type Array. Array.from(obj) is the deep clone of the array .Correct me if I am wrong.
Angelos Chalaris commented
We're looking into this. I'll get back to you.
Henry commented
I believe Array.isArray(obj) checks if obj is of type Array. Array.from(obj) is the deep clone of the array .Correct me if I am wrong.
Array.from is actually the shallow copy of the array. You can check it from here.
Angelos Chalaris commented
Solved in de38320. The code was simplified and some notes were added for this.