The type of elements in the array / 数组元素的类型
The source data to clone. 要克隆的源数据
The cloned data. 克隆后的数据
This function uses JSON.parse(JSON.stringify()) which has the following limitations:
undefined values, functions, and Symbol keys/values are silently droppedDate objects are converted to ISO strings (not Date instances)RegExp, Map, Set, ArrayBuffer, TypedArray are not properly clonedTypeErrorNaN and Infinity are converted to nullFor full deep cloning support, use deepClone instead.
此函数使用 JSON.parse(JSON.stringify()),存在以下限制:
undefined 值、函数和 Symbol 键/值会被静默丢弃Date 对象会转换为 ISO 字符串(而非 Date 实例)RegExp、Map、Set、ArrayBuffer、TypedArray 无法正确克隆TypeErrorNaN 和 Infinity 会被转换为 null如需完整的深克隆支持,请使用 deepClone。
simple clone, use JSON.parse and JSON.stringify
简单的克隆,使用 JSON.parse 和 JSON.stringify