A situation in which an object has a key value of undefined is encountered in a deep copy.

this undefined, will be ignored in all the methods that can be found on the Internet, but in fact, these undefined values are also meaningful. Is there any way to copy these values as undefined?

Oct.15,2021

The value

undefined is undefined, has no meaning in js, and should not be used to express some meaning. Null values should be expressed in null.

can be copied. You can use hasOwnProperty to determine whether key exists, or you can directly use the Object.keys () method

  

at present, the better implementation of deep copy is that the cloneDeep, of lodash can be used directly.

Menu