function buildList(data) {
var $ul = $('<ul></ul>');
for (const key in data) {
var $child = $('<li></li>');
$ul.append($child)
if (typeof data[key] === 'object') {
$child.text = $child.text(key);
$child.append(buildList(data[key]));
} else {
$child.text = $child.text(key + ' : ' + data[key]);
}
}
return $ul;
}