JSFiddle - React, Tailwind, and code Playground

by Alexandru Gatea

JavaScript

var elements = [
    { "a": [ "1", "2", ] }, 
    { "b": [ "1", "2", "3", "4" ] }, 
    { "c": [ "1", "2", "3", "4", "5", "6" ] } 
];
var result = '';
$.each(elements, function(i,e){
    $.each(e, function(ind, elem){
        $.each(elem, function(index, element){
            result += ind + '-' + element + ',';
        })
    })
})
result = result.substring(0, result.length-1);
console.log(result);