JSFiddle - React, Tailwind, and code Playground

by nveron

JavaScript

var a = {
  name: 'toto',
  myNameIs : function(){
    console.log('My name is ' + this.name);
  }
}

var b = function() {
  //this.name = 'boouuu';
}

b.prototype = Object.create(a,{
  name: {
    value: 'blaa'
  }
}
);

c = new b();

c.name ='bluu';

console.log(c.myNameIs());