In Ruby's REPL (Read Evaluate Print Loop) irb, I can query object methods by calling Object.methods(), this returns an Array containing the public and private methods of the object in question (in the example below, I'm querying the String class) e.g.
>String.methods()
=> [:try_convert, :allocate, :new, :superclass, //truncated for brevity
I'm trying to learn Javascript and I'd like to know is there an equivalent function (this is not for coding, but for querying objects in the browser Console). I find this a very effective way to learn.

Object.getOwnPropertyNames(obj)?