Back

Preparing for JavaScript interview?
Here are some frequently asking questions:

What is the object type?

The object type refers to a compound value where you can set properties (named locations) that each hold their own values of any type.

See more

Explain arrays in JavaScript

An array is an object that holds values (of any type) not particularly in named properties/keys, but rather in numerically indexed positions.

See more

What is typeof operator?

JavaScript provides a typeof operator that can examine a value and tell you what type it is.

See more

Explain the same-origin policy with regards to JavaScript.

The same-origin policy prevents JavaScript from making requests across domain boundaries. An origin is defined as a combination of URI scheme, hostname, and port number. This policy prevents a malicious script on one page from obtaining access to sensitive data on another web page through that page's Document Object Model.

See more

Why would you use something like the load event? Does this event have disadvantages? Do you know any alternatives, and why would you use those?

The load event fires at the end of the document loading process. At this point, all of the objects in the document are in the DOM, and all the images, scripts, links and sub-frames have finished loading. The DOM event DOMContentLoaded will fire after the DOM for the page has been constructed, but do not wait for other resources to finish loading. This is preferred in certain cases when you do not need the full page to be loaded before initializing.

See more