Skip to content

美团篇>实现数组和对象的深拷贝 #60

Open
@lixingjuan

Description

@lixingjuan

可以使用JSON.parse(JSON.stringify(arr1)) 实现数组和对象的深拷贝

const arr1 = {
  a:1,
  b:[{name:1}],
  c:{age:1}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions