javascript - How can I change the default behavior of console.log in Safari? -
in safari no add-ons, console.log show object @ last state of execution, not @ state when console.log called.
i have clone object output via console.log state of object @ line.
example:
var test = {a: true} console.log(test); // {a: false} test.a = false; console.log(test); // {a: false}
i think you're looking console.dir().
console.log() doesn't want because prints reference object, , time pop open, it's changed. console.dir prints directory of properties in object @ time call it.
the json idea below one; go on parse json string , browsable object .dir() give you:
console.log(json.parse(json.stringify(obj)));
Comments
Post a Comment