JSFiddle - React, Tailwind, and code Playground

by amatiasq

HTML

<script src="http://amatiasq.com/fiddle-console.js"></script>

JavaScript

function myFunct() { }
myFunct.prototype = {
    name: "Alice",
    lastname: "Smith",
    fullname: function() { 
        return this.name + ' ' + this.lastname;
    }
};

var instancia1 = new myFunct();
var instancia2 = new myFunct();

instancia1.name = "Bob";
function extenderInstancia1() { }
extenderInstancia1.prototype = instancia1;
var subInstancia = new extenderInstancia1();

var texto = "Fullname: " + subInstancia.fullname() + '\n';
texto += "Es instancia de extenderInstancia1? " + (subInstancia instanceof extenderInstancia1) + '\n';
texto += "Es instancia de myFunct? " + (subInstancia instanceof myFunct) + '\n';
texto += "Es instancia de Object? " + (subInstancia instanceof Object);

console.log(texto);