JSFiddle - React, Tailwind, and code Playground

by rwaldron

JavaScript

// what really happens....
function object(){
    this.type='object';
}

function testObject(){
    object.call(this);
    this.type='testObject';
}

var test=new testObject();

testObject.prototype.constructor=new object;
testObject.prototype = new object;
testObject.prototype.constructor=new testObject;


console.log("testObject.prototype", testObject.prototype)
console.log("testObject.prototype.constructor", testObject.prototype.constructor)


console.log('Obj:%o',test);


console.log(test.constructor);// <-- undefined


if ( $.isPlainObject(test) ) {
    console.log('Plain Test Object');
}    
else {
    console.log('other');
}