JSFiddle - React, Tailwind, and code Playground

by Dogbert

JavaScript

// http://stackoverflow.com/questions/11920931/jquery-object-info-retraival-issue

var myObj = {
    info:[
        [
            [
                {'name':'first Name'},
                {'name' : 'Second Name'}
            ]
        ]
    ]
};

function get(data) {
    var ret = [];
    if(typeof data == 'object') {
        if(data.length === 1) {
            return data;
        } else {
            $.map(data, function(value, key) {
                var got = get(value);
                if(got.length === 1) {
                    ret.push(got);
                }
            });
        }
    }
    return ret;
}

console.log(get(myObj));