JSFiddle - React, Tailwind, and code Playground
by justindeal
HTML
<pre id="container"/>
Babel + JSX
const obj = Object.create(null);
obj.name = 'Bob';
let debugInfo = '';
try {
// This will fail, because obj has no prototype.
obj.hasOwnProperty('name');
} catch (e) {
debugInfo += e.message + '\n\n';
}
// This will work fine.
Object.prototype.hasOwnProperty.call(obj, 'name');
debugInfo += `Object has 'name' property.`;
document.getElementById('container').innerHTML = debugInfo;