JSFiddle - React, Tailwind, and code Playground

by pentium10

JavaScript

var collection = [];
var p = {
    col:1,
};
function class1() 
{
    this.name = "Q";
}
class1.prototype.toString = function()
{
    return this.name;
}
    var q=new class1();
    var r=new class1();

//current_index=1
//[p,q]
var plugins = [p,q,r];
var attributes = ['title','price','img','gallery','joke','fff'];

var complete=[];
complete['title']=1;
var complete_index=5;
// complete['title'] trece 0 -> 1
// container.title <--

collection['title']=[];
collection['title'][0]=1;
collection['title'][1]=1;
collection['price']=[];
collection['price'][0]=0;
collection['price'][1]=0;
collection['joke']=[];
collection['joke'][1]=0;
collection['img']=[];
collection['img'][1]=0;
collection['img'][2]=0;
collection['gallery']=[];
collection['gallery'][1]=0;
collection['fff']=[];
collection['fff'][0]=0;
collection['fff'][2]=0;
//collection['price']['plugin2']=1;
//console.log(collection['title'][p]);
function print_2d_string_array (arr,attributes,plugins )
{
    console.log(attributes)
    document . writeln ("<table border>");
    var row,i,j;
    var x=0,y=0;
  for (i = 0; i < attributes . length; ++ i)
    {
        
        row=attributes[i];
  
  
            y++;
           
        console.log(row)
        
        var col;
            if (y==1) {
            var temp;
                document . writeln (" <tr>");
                document . writeln ("  <td>-</td>");
                for (j = 0; j < plugins . length; ++ j) {
                    temp=plugins[j];
     //       for (temp in arr[row] ) {
//                 if (arr[row].hasOwnProperty(temp)) {
                     document . writeln ("  <td>" + temp+ "</td>");
  //               }
            }
            document . writeln (" </tr>");
        }
        document . writeln (" <tr>");    
        document . writeln ("  <td>" + row + "</td>");        
         for (j = 0; j < plugins . length; ++ j) {
                 //col=plugins[j];
                 col=j;
                 if (arr[row]!=undefined &&...