function recursive(obj) { var output = ''; if (typeof obj === 'object') { for (var key in obj) { var item = obj[key]; if (typeof item === 'object') { output += recursive(item); } else { output += key + ':' + item + '\n'; } } } else { output += obj + '\n'; } return output;}