标签云

微信群

扫码加入我们

WeChat QR Code


Note too that this isn't one-size-fits-all - this is unlikely to do anything useful for built-in objects like DOM nodes where you'd want to use cloneNode() method, etc.

2019年02月24日24分05秒

obj.i will not work, you will access to the "i" property literally, you need to use the bracket notation, e.g. obj[i]

2019年02月24日24分05秒

CMS: thanks, I've fixed it now.

2019年02月24日24分05秒

This does not seem right. cloneObject({ name: null }) => {"name":{}}

2019年02月24日24分05秒

Niyaz: Thanks, I added a fix.

2019年02月24日24分05秒

Ew, eval()! Not sure this would work either, unless obj has a meaningful toString() method.

2019年02月24日24分05秒

would that not return a reference?

2019年02月24日24分05秒