JSFiddle - React, Tailwind, and code Playground
by Walter Rumsby
HTML
<code>foo</code>
<table>
<tr>
<td>
<code>foo.email</code>
</td>
<td id="foo_email"></td>
<td id="foo_email_value"></td>
</tr>
<tr>
<td>
<code>foo.hasOwnProperty('email')</code>
</td>
<td id="foo_hasownproperty_email"></td>
</tr>
</table>
JavaScript
const Foo = function (name) {
this.name = name;
};
Foo.prototype = {
email: undefined
};
const foo = new Foo('test');
foo.email = undefined;
document.getElementById('foo_email').innerHTML = foo.email ? 'true' : 'false';
document.getElementById('foo_email_value').innerHTML = '' + foo.email;
document.getElementById('foo_hasownproperty_email').innerHTML = foo.hasOwnProperty('email') ? 'true' : 'false';