JSFiddle - React, Tailwind, and code Playground

by btipling

JavaScript

var prototypeDef = {
    bar: "protoBar",
};
var propertiesDef = {
    bar: {
        value: "instanceBar",
    },
    log: {
        value: function () {
            console.log(this.bar);
        }
    }
}
 
var foo = Object.create(prototypeDef, propertiesDef);
foo.log(); //logs "instanceBar"