My first interview question with HCL was: what is the output of "Console.log(this);" when you open type it in Console of Chrome?
Below is the answer in the screenshot. It's a Window object. This object is a top level object in client side JavaScript, representing a Window or a Frame. If you expand this object, as shown in below screenshot, you will see its child objects: document, history, etc. Go explore it.
Comments
Post a Comment