JSFiddle - React, Tailwind, and code Playground

JavaScript

var x = {};
alert([
    $.isPlainObject(x),      // true
    $.isPlainObject({a: 42}) // true
]);
Object.prototype.foo = function(){};
alert([
    $.isPlainObject(x),      // false
    $.isPlainObject({}),     // false
    $.isPlainObject({a: 42}) // false
]);