JSFiddle - React, Tailwind, and code Playground
by amatiasq
HTML
<script src="http://amatiasq.com/fiddle-console.js"></script>
JavaScript
(function(global) {
var secreto = {};
function Persona() { }
Persona.prototype = {
guardarSecreto: function(susurro) {
secreto[this] = susurro;
},
revelarSecreto: function() {
return secreto[this];
}
};
global.Persona = Persona;
})(this);
var pepe = new Persona();
var maria = new Persona();
pepe.guardarSecreto('estás en matrix');
console.log(maria.revelarSecreto());