0% found this document useful (0 votes)
13 views3 pages

JavaScript Quiz: Multiple Choice Questions

The document contains a series of multiple-choice questions related to JavaScript, along with their correct answers. Topics covered include string methods, data type checks, DOM manipulation, event handling, and mathematical functions. Each question is followed by three options, with the correct answer indicated in a separate section at the end.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

JavaScript Quiz: Multiple Choice Questions

The document contains a series of multiple-choice questions related to JavaScript, along with their correct answers. Topics covered include string methods, data type checks, DOM manipulation, event handling, and mathematical functions. Each question is followed by three options, with the correct answer indicated in a separate section at the end.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JavaScript multiple choice questions with answers

What method allows you to search for a word in a string?

match(SearchWord)
find(SearchWord)
search(SearchTerm)

What does isNaN(var) check?

If var is defined
If var is a string
If var is not a number

Which method clears a timer?

clearSetTime()
clearTime()
clearTimeout()

How to add an item to a list?

[Link]("myList").appendChild(newListItem);
[Link]("myList").newChild(newListItem);
[Link]("myList").addChild(newListItem);

How to assign a value to an item in a list called node?

[Link]([Link]("Water"));
[Link]([Link]("Water"));
[Link]([Link]("Water"));

How to round the number 7.25 down to the nearest integer?

floor(7.25)
[Link](7.25)
[Link](7.25)

What allows to perform multiple tests on the same value?


case
iif
switch

How to retrieve the client's browser name?

[Link]
[Link]
[Link]

Which method allows you to retrieve an HTML element by its name?

getElementByName(name);
getElementsByTagName(name);
getElementBy(name);

What event is triggered when a text is modified in an input?

onchange
onload
onmodif

What is [Link] used for?

Return the number of URLs in the history list


Return the number of times the site has been visited
Return the number of shortcuts

How to access the properties of an object?

myObj->property;
monObj[property];
monObj["propriete"];

How to return a random number between 0 and 1?

random(0,1)
[Link](0,1)
[Link]()

How to return the maximum value between 6 and 7.25?

max(6,7.25)
[Link](6,7.25)
[Link](6,7.25)

How to retrieve the X position in the string "txt"?

[Link]("X");
[Link]("X");
[Link]("X")

When trying to retrieve the 'name' value belonging to a non-existent 'identity' object, how
avoid raising the TypeError exception?

var value = identity ? identity. name : '';


var value = identity. name || '';
var value = [Link];

test = 1+3+"1"; Combien vaut test ?

5
131
41
What is the difference between [Link] and [Link]?

[Link] returns the entire url


[Link] returns the entire url
[Link] only returns the page name

How to round the number 7.25 to the nearest integer?

round(7.25)
[Link](7.25)
[Link](7.25)

What method allows you to call a function after a given time?

setTime()
Time()
setTimeout()
Correction
1 match(SearchWord)
2 If var is not a number
3 clearTimeout()
4 [Link]("myList").appendChild(newListItem);
5 [Link]([Link]("Water"));
6 [Link](7.25)
7 switch
8 [Link]
9 getElementsByTagName(name);
10 onchange
12 Return the number of URLs in the history list
12 monObj["propriete"];
13 [Link]()
14 [Link](6,7.25)
15 [Link]("X")
16 var value = identity ? identity. name : '';
17 41
18 [Link] returns the entire URL
19 [Link](7.25)
20 setTimeout()

You might also like