0% found this document useful (0 votes)
19K views

Javascript Pre Test: A) Event Type

The document is a 20 question JavaScript pre-test that assesses knowledge of JavaScript concepts like events, arrays, functions, and objects. It contains multiple choice questions testing understanding of event types, event targets, event handlers, event propagation, arrays, return values, function invocation, and using for-in loops to iterate object properties.

Uploaded by

swapna jr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19K views

Javascript Pre Test: A) Event Type

The document is a 20 question JavaScript pre-test that assesses knowledge of JavaScript concepts like events, arrays, functions, and objects. It contains multiple choice questions testing understanding of event types, event targets, event handlers, event propagation, arrays, return values, function invocation, and using for-in loops to iterate object properties.

Uploaded by

swapna jr
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

JavaScript Pre Test

Participant Name: Vendor


EM ID: Name:

Training Name: JavaScript


Total
/ 20
Trainer Name: Swapna R Score:

Choose the correct answer:

1. The type that specifies what kind of event occured is

A) event type

B) even target

C) both event type and even target

D) none of the mentioned

2. Which is the object on which the event occured or with which the event is associated?

A) event type

B) event target

C) both event type and even target

D) none of the mentioned

3. In general, event handler is nothing but

A) function

B) interface

C) event

D) handler

4. When will the browser invoke the handler?

A) Program begins

B) Any event occurs

C) Specified event occurs

D) None of the mentioned

5. Which property specifies the property of the event?

A) Type B) Target

C) Manner D) All of the mentioned


6. The process by which the browser decides which objects to trigger event handlers on is

A) Event Triggering

B) Event Listening

C) Event Handling

D) Event propogation

7. Which form of event propogation handles the registered container elements?

A) Event Propogation

B) Event Registration

C) Event Capturing

D) Default Actions

8. The events that are directly tied to a specific input device are

A) Device-independent input events

B) Device-dependent input events

C) User interface events

D) State change events

9. The high-level events among the following events are

A) User interface events

B) Device-independent events

C) Device-dependent events

D) All of the mentioned

10. The events that are not directly tied to a specific input device are

A) User interface events

B) Device-independent events

C) Device-dependent events

D) All of the mentioned

11. 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. None of the mentioned
12. Consider the following code snippet
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
The result would be
A. true false
B. false true
C. true true
D. false true

13. Consider the following code snippet :


if (!a[i]) continue;
What is the observation made ?
A. Skips the undefined elements
B. Skips the non existent elements
C. Skips the null elements
D. All of the mentioned

14. The method or operator used to identify the array is

A. isarrayType()
B. ==
C. ===
D. Typeof
15. Consider the following code snippet :
var a = [];
a.unshift(1);
a.unshift(22);
a.shift();
a.unshift(3,[4,5]);
a.shift();
a.shift();
a.shift();
The final output for the shift() is
A. 1
B. [4,5].
C. [3,4,5].
D. Exception is thrown
16. What will happen if a return statement does not have an associated expression?
A. It returns the value 0
B. It returns the value 0
C. It returns the undefined value
D. None of the mentioned
17. A function with no return value is called
A. Procedures
B. Method
C. Static function
D. Dynamic function
18. Which of the following is the correct code for invoking a function without this
keyword at all, and also too determine whether the strict mode is in effect?

A. var strict = (function { return this; });


B. mode strict = (function() { return !this; }());
C. var strict = (function() { return !this; }());
D. mode strict = (function { });

19. Consider the following code snippet


function hypotenuse(a, b)
{
function square(x)
{
return x*x;
}
return Math.sqrt(square(a) + square(b));
}
What does the above code result?
A. Sum of square of a and b
B. Square of sum of a and b
C. Sum of a and b square
D. None of the mentioned

20. Consider the following code snippet


function printprops(o)
{
for(var p in o)
console.log(p + ": " + o[p] + "\n");
}
What will the above code snippet result ?
A. Prints the contents of each property of o
B. Returns undefined
C. All of the mentioned
D. None of the mentioned

You might also like