2

I am building a javascript editor autocomplete, and I would like to list all top-level things that are available. I tried:

Object.keys(window)

and

for (k in window) 

but it doesn't look like either is returning things like 'Math' or 'Array'. How can I get everything from window?

edeboursetty
  • 5,669
  • 2
  • 40
  • 67

1 Answers1

4

Object.getOwnPropertyNames() contains Math, Array, ... etc.

check this question : Object.getOwnPropertyNames vs Object.keys

Community
  • 1
  • 1
wafe
  • 382
  • 2
  • 3