JSFiddle - React, Tailwind, and code Playground
JavaScript
// de test function staat in alle versie van de objecten
// maar is eigenlijk identiek, dus overbodig om zoveel
// keer te herhalen
var a = {
nr: 50,
test:function(){ document.write(this.nr+'<hr>'); }
}
var b = {
nr: 100,
test:function(){ document.write(this.nr+'<hr>'); }
}
var c = {
nr: 200,
test:function(){ document.write(this.nr+'<hr>'); }
}
// ... etc
a.test();
//b.test();
//c.test();