4 ms·
JSON.parse(JSON.stringify(obj)).hasOwnProperty('foo') false Thing is, other parts of the code might actually serialize and unserialize objects. If you rely
by WA 6y ago
JSON.parse(JSON.stringify(obj)).hasOwnProperty('foo')
false
Thing is, other parts of the code might actually serialize and unserialize objects. If you rely on a prop being 'undefined' meaning "prop is unknown like the firstName", as OP suggested, you might be in for a surprise.