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
  • 90,630
  • 105
  • 267
  • 383

5 Answers5

11
console.dir( someObject );
Marcel Korpel
  • 21,536
  • 6
  • 60
  • 80
Šime Vidas
  • 182,163
  • 62
  • 281
  • 385
  • 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
  • 623,446
  • 136
  • 1,297
  • 1,155
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
  • 32,086
  • 48
  • 148
  • 223
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
  • 21
  • 5
0

Use Object.getPrototypeOf

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