标签云

微信群

扫码加入我们

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.

2018年12月17日17分46秒

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

2018年12月17日17分46秒

CMS: thanks, I've fixed it now.

2018年12月17日17分46秒

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

2018年12月18日17分46秒

Niyaz: Thanks, I added a fix.

2018年12月18日17分46秒

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

2018年12月17日17分46秒

would that not return a reference?

2018年12月17日17分46秒