JavaScript Questions and Answers
51.Javascript is ideal to?
A. make computations in HTML simpler
B. minimize storage requirements on the web server
C. increase the download time for the client
D. none of the mentioned
View Answer
Ans : B
Explanation:Javascript helps in doing various tasks with minimum storage requirements. Therefore, to reduce storage requirements, Javascript has always said a better one. explanation.
52. The meaning for Augmenting classes is that:
A. objects inherit prototype properties even in dynamic state
B. objects inherit prototype properties only in dynamic state
C. objects inherit prototype properties in static state
D. object doesn’t inherit prototype properties in static state
View Answer
Ans : A
Explanation:Javascript's prototype-based inherit system is dynamic: an object inherits properties with its prototype, even if the prototype changes after the creation of the object. This means that we can increase JavaScript classes by adding new methods only to their prototype objects.
53. Which is the handler method used to invoke when uncaught JavaScript exceptions occur?
A. Onhalt
B. Onerror
C. Both onhalt and onerror
D. Onsuspend
View Answer
Ans : B
Explanation: The onerror handler method can be registered to be invoked when uncaught JavaScript exceptions occur. The onerror event is triggered if an error occurs while loading an external file .
54. Consider the code snippet given below
var count = [1,,3];
What is the observation made?
A. The omitted value takes "undefined"
B. This results in an error
C. This results in an exception
D. The omitted value takes an integer value
View Answer
Ans : A
Explanation:Array is defined with a null value when no value is mentioned. If you omit a value from an array literal, the omitted element is given an undefined value.
55. Which among the following POSIX signals generate events?
A. SIGDOWN
B. SIGFLOAT
C. SIGINT
D. SIGSHORT
View Answer
Ans : C
Explanation:The SIGINT is a POSIX signal that generates event. A simple code like below can do a proper clean up and exit on CTRL-C or SIGINT passed from command line / other application to the nodejs app’s ProcessID.
56. What does the interpreter do when you reference variables in other scopes?
A. Traverses the queue
B. Traverses the stack
C. Finds the bugs
D. Traverse the array
View Answer
Ans : B
Explanation:The interpreter executes the javascript code. Normally when you reference variables in other scopes at the global level, in other namespaces, and so on—the interpreter needs to traverse the stack to get to the variable.
57. What must be done in order to implement Lexical Scoping?
A. Get the object
B. Dereference the current scope chain
C. Reference the current scope chain
D. Return the value
View Answer
Ans : C
Explanation: In order to implement lexical scoping, the internal state of a JavaScript function object must include not only the code of the function but also a reference to the current scope chain.
58. From which version of IE is canvas supported?
A. 6
B. 7
C. 8
D. 9
View Answer
Ans : D
Explanation: The canvas element is not supported by IE before IE9, but it can be reasonably well emulated in IE6, 7, and 8. It is supported from version 4 in chrome and 2 in firefox.
59. How many parameters does the method plot() accept?
A. 7
B. 8
C. 9
D. 10
View Answer
Ans : C
Explanation: Plot() is a generic function, meaning, it has many methods which are called according to the type of object passed to plot() . The method plot() accepts a total of 9 parameters.
60.What is the purpose of script loading?
A. Load Scripts programmatically
B. Load JavaScript files manually
C. Load JavaScript files programmatically
D. All of the mentioned
View Answer
Ans : C
Explanation:The script loading loads remote JavaScript files programmatically and allow us to trick the rendering engine. The async attribute is a boolean attribute. When present, it specifies that the script will be executed asynchronously as soon as it is available.
Also check :
Discussion