JSFiddle - React, Tailwind, and code Playground
JavaScript
var MaClass = function() {
this.attribut = new Element();
}
MaClass.prototype = {
getAttribut: function() {
return this.attribut;
},
setAttribut: function(value) {
this.attribut = value;
}
}
var Element = function() {
this.core = "truc";
}
Element.prototype = {
getCore: function() {
return this.core;
},
setCore: function(value) {
this.core = value;
}
}
var objet1 = new MaClass;
objet1.getAttribut().setCore("bidule");
alert(objet1.getAttribut().getCore());