I revised this loop someone had created and it works perfectly
function dump(obj) {
var out = '\n\n//Begin Dump \n';
for (var i in obj) {
out += i + ": " + obj[i] + "\n";
}
$.write(out)
}
This has already helped me identify parts of the object without having to google.
Only downside is, I don't think I understand the structure of layers enough to get it to work on every case:
Example that breaks altogether::
dump(activeDocument.activeLayer)