Closed Bug 891431 Opened 11 years ago Closed 6 years ago

Giving a name to objects logged using console.log()

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jorendorff, Unassigned)

Details

jonathanj noted on IRC that if you've done console.log(obj), you can see the "[object Object]" in the console, you can click on it and view and edit properties, but you can't use JS to ask questions about it. You can't call its methods, or check to see if it's the same object as some other object, because it doesn't have a name.

He suggested, when you right-click on the console.log output, a "Send to Scratchpad" option.

msucan suggested a "Pin Object" option that would give that object a number,
and then you could refer to it as $0 or $1 or something in the console.
Assignee: general → nobody
Component: JavaScript Engine → Developer Tools: Console
Product: Core → Firefox
Priority: -- → P3
Product: Firefox → DevTools
I think we can close this as we have a similar mechanism in the console now: you can right click on an object and select `Store as global variable`, which will give you a way to play with said object.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.