The short answer to how to clone objects is simply to use Object.assign({}, obj), for a shallow copy and JSON.parse(JSON.stringify(obj)) for a deep clone of the ...
確定! 回上一頁