JSFiddle - React, Tailwind, and code Playground

by Konstantin Rouda

JavaScript

const obj = {
   name: "Konstantin",
   init () {
   		obj.render();
   },
   render () {
      const dogFrag = document.createDocumentFragment();
      ["A", "B", "C"].map((item) => {
         const btn = document.createElement("button");
         btn.onclick = (e) => { 
         		var i = this.name;
         		debugger; 
         };
         dogFrag.appendChild(btn);
         return btn;
      });
      document.body.appendChild(dogFrag);
   }
};


obj.init();