Server Side And Client Side Scripting(Javascript ) Questions and Answers

Question 1. What are the events generated by the Node objects called?
  1.    generators
  2.    emitters
  3.    dispatchers
  4.    highevents
Explanation:-
Answer: Option B. -> emitters
Node objects that generate events (known as event emitters) define an on() method for registering handlers.

Question 2. Which function is a synonym for on()?
  1.    addListener()
  2.    listeners()
  3.    once()
  4.    add()
Explanation:-
Answer: Option A. -> addListener()
The on() method is used for registering handlers. addListener() is a synonym for on().

Question 3. Which of the following is an event emitter?
  1.    once
  2.    process
  3.    listeners
  4.    on
Explanation:-
Answer: Option B. -> process
The process object is an event emitter. The Node defines other important globals under the process namespaces that contain properties of that object like version, argv, env, pid,getuid(), cwd(), chdir() and exit().

Question 4. What is the function used to remove all handlers for name events?
  1.    deleteAllListeners(name)
  2.    deleteListener(name,f)
  3.    removerListener(name,f)
  4.    removeAllListeners(name)
Explanation:-
Answer: Option D. -> removeAllListeners(name)
The removeAllListeners(name) is used to remove all handlers from name events represented as :
emitter.removeAllListeners(name)

Question 5. What is the function used to deregister event handler ‘f’?
  1.    deleteAllListeners(name)
  2.    deleteListener(name,f)
  3.    removerListener(name,f)
  4.    removeAllListeners(name)
Explanation:-
Answer: Option C. -> removerListener(name,f)

Question 6. The libraries that build a new higher-level API for client-side programming is
  1.    Library
  2.    Framework
  3.    APIs
  4.    All of the mentioned
Explanation:-
Answer: Option B. -> Framework
Many web developers find it useful to build their web applications on top of a clientside framework library. These libraries are “frameworks” in the sense that they build a new higher-level API for client-side programming on top of the standard and proprietary APIs offered by web browsers: once you adopt a framework, your code needs to be written to use the APIs defined by that framework.

Question 7. Which of the following is not a framework?
  1.    jQuery
  2.    .NET
  3.    JavaScript
  4.    None of the mentioned
Explanation:-
Answer: Option C. -> JavaScript
One of the most popular frameworks is jQuery. Here, JavaScript is a scripting language and not a framework.

Question 8. What is the purpose of Dojo framework?
  1.    Focuses on DOM and Ajax utilities
  2.    Advertises incredible depth
  3.    Ajax utilities
  4.    None of the mentioned
Explanation:-
Answer: Option B. -> Advertises incredible depth
Dojo is a large framework that advertises its “incredible depth.” It includes an extensive set of UI widgets, a package system, a data abstraction layer, and more.

Question 9. Which of the following frameworks focuses on DOM and Ajax utilities?
  1.    jQuery
  2.    Prototype
  3.    Dojo
  4.    Both jQueryand Prototype
Explanation:-
Answer: Option D. -> Both jQueryand Prototype
The Prototype library focuses on DOM and Ajax utilities like jQuery does, and adds quite a few core-language utilities as well.

Question 10. Which is the in-house library of Yahoo!?
  1.    Dojo
  2.    YUI
  3.    Prototype
  4.    Closure
Explanation:-
Answer: Option B. -> YUI
YUI is the in-house library of Yahoo!, and it is used on their home page.