JSFiddle - React, Tailwind, and code Playground

by Kevin Faulhaber

HTML

<ul id="container"></ul>

JavaScript

//Object O correct example
var o = new Object();
o['test1'] = ['a', 'b', 'c', 'd', 'e', 'f'];
o['test2'] = ['aa', 'bb', 'cc', 'dd', 'ee', 'ff'];
o['test3'] = ['aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff'];

//checking to see if it's the correctly built
console.log(o);

//using jquery
$.each(o, function(a, b){
    $.each(b, function(c, d){
        $('#container').append('<li data-category="' + a + '">' + d + '</li>');
    });
});