JSFiddle - React, Tailwind, and code Playground
by Julien Etienne
JavaScript
var result;
function Human(name, age){
this.name = name;
this.age = age;
this.sayAge = function(){
alert('My name is ' + this.name + ' i am ' + this.age);
}
}
var newPerson = new Human('Julien', 31);
// newPerson.sayAge();
//result = Object.getPrototypeOf(newPerson);
// console.log(result) = Human {}
// console.log(result.prototype) = undefined
//result = newPerson.__proto__;
// console.log(result) = Human {}
// console.log(result.prototype) = undefined
// result = Object.create(Human);
// console.log(result) = Object {}
// console.log(result.prototype) = Human {}
// result = new Human;
// console.log(result) = Human {name: undefined, age: undefined, sayAge: function}
// console.log(result.prototype) = undefined
// result = new Human('joe', 43);
// console.log(result) = Human {name: "joe", age: 43, sayAge: function}
// console.log(result.prototype) = undefined
console.log(result,result.prototype);