I just use JSON.stringify
when i need it. Don't know if it will do it for you, but it is easy and effective for debugging purposes.
This is no good for objects with function references in it tho, so if you need that i would consider using either a deep copy of the object (you can use jQuery's excellent extend
method) or roll you own logging function that will loop recursively over the object and print it out.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…