Expert JavaScript Developer

  Home  Client Side Scripting  Expert JavaScript Developer


“Expert JavaScript Developer Frequently Asked Questions in various Expert JavaScript Developer job Interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”



208 Expert JavaScript Developer Questions And Answers

201⟩ What is unescape() function?

► The unescape() function is used to decode the encoded string.

► Syntax : unescape(string1)

► Where string1 is the string to be decoded.

► Example :

<script>

document.write(unescape("Questions%3F%20Get%20from%20us%21"));

</script>

- Output :

Questions? Get from us!

 227 views

202⟩ What is namespacing in JavaScript and how is it used?

Namespacing is used for grouping the desired functions, variables etc. under a unique name. It is a name that has been attached to the desired functions, objects and properties. This improves modularity in the coding and enables code reuse.

 262 views

203⟩ What is the difference between window.onload and onDocumentReady?

► The difference is that onDocumentReady is called after the DOM is loaded without waiting for all the contents to get loaded. While window.onload() function waits until the contents of page is loaded.

► Suppose there is very large image on a page, at that time onDocumentReady will wait until that image is loaded totally.

► So while using the window.onlaod() function the execution will be slow, but the onDocumentReady will not wait until the image is loaded.

 226 views

204⟩ How can I prevent others from reading/stealing my scripts or images?

There are no assertive measures which can be taken to foolproof your scripts and images, but preventive measures can be taken like copyrighting your pages, putting watermark on your images and applying non-technological way to protect your images. Scripts are difficult to protect as they can be accessed through many applications and many programs by using the web browsers.

 199 views

205⟩ Explain the concept of unobtrusive JavaScript?

Unobtrusive JavaScript is basically a JavaScript methodology that seeks to overcome browser inconsistencies by separating page functionality from structure. The basic premise of unobtrusive JavaScript is that page functionality should be maintained even when JavaScript is unavailable on a user's browser.

 189 views

207⟩ What happens when you don't declare a variable in Javascript?

If you don't explicitly declare a variable, you risk creating an implied global variable. This is a problem, as you will be unable to create multiple instances of that object, as each new instance will overwrite the data from the last.

In general, global variables should be used only in very specific situations and are typically not recommended, as they can lead to a lot of odd side effects that may be difficult to track down.

 226 views

208⟩ Can you use x === "object" to test if x is an object?

In short, yes, but you must take into account the fact that null is considered an object in JavaScript. Even if x is null, 'console.log(typeof x === "object")' will log true instead of false.

To account for this, you must also test whether or not x is null by including the following:

console.log((x !== null) && (typeof x === "object"));

 237 views