Instruction
- Total number of questions : 30.
- Time alloted : 30 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
JavaScript is ideal to |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: To minimise storage requirements, JavaScript is always a better say. |
2. |
When there is an indefinite or an infinity value during an arithmetic value computation, javascript |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: When the result of a numeric operation is larger than the largest representable number (overflow), the result is a special infinity value, which JavaScript prints as Infinity. Similarly, when a negative value becomes larger than the largest representable negative number, the result is negative infinity, printed as -Infinity. The infinite values behave as you would expect: adding, subtracting, multiplying, or dividing them by anything results in an infinite value (possibly with the sign reversed). |
3. |
The JavaScript’s syntax calling ( or executing ) a function or method is called |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: An invocation expression is JavaScript’s syntax for calling (or executing) a function or method. It starts with a function expression that identifies the function to be called. |
4. |
A statement block is a |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: A statement block is a block that combines more than one statements into a single compound statement for ease. |
5. |
One of the special feature of an interpreter in reference with the for loop is that |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property (a string value) to it. |
6. |
Consider the below given syntax
book[datatype]=assignment_value;In the above syntax, the datatype within the square brackets must be |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: When using square bracket notation, the expression inside the square brackets must evaluate to a sting or a value that can be converted to a string. |
7. |
What will happen if reverse() and join() methods are used simultaneously ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The reverse() followed by a join() will reverse the respective array and will store the reversed array in the memory. |
8. |
What will happen if a return statement does not have an associated expression? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: If the return statement does not have an associated expression, it returns the undefined value. |
9. |
Consider the following code snippet : function constfuncs() { var funcs = []; for(var i = 0; i < 10; i++) funcs[i] = function() { return i; }; return funcs; } var funcs = constfuncs(); funcs[5]() |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The code above creates 10 closures, and stores them in an array. The closures are all defined within the same invocation of the function, so they share access to the variable i. When constfuncs() returns, the value of the variable i is 10, and all 10 closures share this value. Therefore, all the functions in the returned array of functions return the same value. |
10. |
Which of the following uses a lot of CPU cycles? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Dynamically generating graphics from real-time data uses a lot of CPU cycles. |
11. |
The meaning for Augmenting classes is that |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: JavaScript’s prototype-based inheritance mechanism is dynamic: an object inherits properties from its prototype, even if the prototype changes after the object is created. This means that we can augment JavaScript classes simply by adding new methods to their prototype objects. |
13. |
Modules that have more than one item in their API can |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Modules that have more than one item in their API can return a namespace object. |
14. |
What will be the result when non greedy repetition is used on the pattern /a+?b/ ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Using non greedy repetition may not always produce the results you expect. /a+?b/ matches the letter b preceded by the fewest number of a’s possible. |
15. |
Which is the subset that is a secure container designed for the purpose of safely running untrusted JavaScript? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: There is a larger class of subsets that have been designed for the purpose of safely running untrusted JavaScript in a secure container or “sandbox”. |
16. |
Consider the following code snippet console.log(p)If p is not defined, what would be the result or type of error? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: In the above code snippet, p is not defined. Hence, it gives a ReferenceError. |
17. |
What is the return type of typeof for standard JavaScript objects? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The typeof operator returns “object” for all standard JavaScript objects as functions are, and the typeof operator returns “xml”. |
18. |
Which of the following is an event emitter? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: 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(). |
19. |
Which is a useful way to try out small and simple Rhino programs and one-liners? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Rhino is distributed as a JAR archieve. Start it with a command line like this : |
20. |
What is the command used for debugging output in Node? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Node defines console.log() for debugging output like browsers do. |
21. |
Which is the most appropriate database for developers requiring huge amount of data? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Developers who need to work with really huge amounts of data like to use databases, and the most recent browsers have started to integrate client-side database functionality into their browsers. |
22. |
What is the code for getting the current time? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The above code determines the current time and stores it in the variable “now”. |
23. |
Which Window object method is used to display message in a dialog box? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The Window object also defines methods like alert(), which displays a message in a dialog box. |
24. |
Which handler is triggered when the content of the document in the window is stable and ready for manipulation? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: One of the most important event handlers is the onload handler of the Window object. It is triggered when the content of the document displayed in the window is stable and ready to be manipulated. JavaScript code is commonly wrapped within an onload event handler. |
25. |
Which is the in-house library of Yahoo!? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: YUI is the in-house library of Yahoo!, and it is used on their home page. |
26. |
Which method receives the return value of setInterval() to cancel future invocations? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Like setTimeout(), setInterval() returns a value that can be passed to clearInterval() to cancel any future invocations of the scheduled function. |
27. |
What is the function used to extract arguments from the search property of a URL? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The urlArgs() function can be used to extract arguments from the search property of a URL. |
28. |
What is the special feature of the modern web applications? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Modern web applications can dynamically alter their own content without loading a new document. |
29. |
A new web browser window can be opened using which method of the Window object ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: You can open a new web browser window with the open() method of the Window object. Window.open() loads a specified URL into a new or existing window and returns the Window object that represents that window. |
30. |
The nodes that represent HTML elements are the |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The nodes that represent HTML elements are Element nodes. |