[Javascript] JSON.parse, structuredClone, loadsh.cloneDeep
Both JSON.parse(JSON,strigify())
& structuredClone
doesn't work with Date
and function
.
var foo = {name: 'foo', bar: () => 'bar'}
var foo2 = structuredClone(foo)
// caught DOMException: Failed to execute 'structuredClone' on 'Window': () => 'bar' could not be cloned.
Only lodash.cloneDeep is working as expected in any cases.