6

I really love the Chrome console because it autocompletes all the object methods for me.

But it only shows one at a time and I have to press TAB to step to the next one.

Is there a way to show a list of all the autocompletion object methods?

never_had_a_name
  • 85,690
  • 100
  • 264
  • 377

5 Answers5

11
console.dir( someObject );
Marcel Korpel
  • 21,285
  • 5
  • 59
  • 80
Šime Vidas
  • 173,790
  • 60
  • 275
  • 374
  • This did not work for me. The auto complete showed a method, which did not appear in console.dir. Another note: Putting the object into the watch, and expanding the watch, shows similar output to console.dir (again missing a method that auto complete shows) – giwyni Jan 29 '17 at 01:31
  • @giwyni Could you share details? Which object and which method? – Šime Vidas Jan 29 '17 at 04:43
2

You could loop though and print them. Here's an example for window:

for(var i in window) if(window.hasOwnProperty(i)) console.log(i);
Nick Craver
  • 610,884
  • 134
  • 1,288
  • 1,151
1

I noticed in recent versions (10+) of Chrome, you can just type the object name and it will build you a tree of the object:

someObject;
Ben McCormack
  • 30,956
  • 46
  • 141
  • 215
0

you can also use console.log(someObject);

Ben McCormack's way works as well, you just need to be Paused on breakpoint (in Chrome DevTools > Sources )

ILS
  • 1
  • 4
0

Use Object.getPrototypeOf

Object.getPrototypeOf(objectHere)
// or
console.dir(Object.getPrototypeOf(objectHere))
William Will
  • 23
  • 1
  • 4