• JavaScript Video Tutorials

Javascript Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Javascript Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Is JavaScript a case-sensitive language?

A - true

B - false

Answer : A

Explanation

Yes! JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.

Q 2 - Which of the following is the correct syntax to print a page using JavaScript?

A - window.print();

B - browser.print();

C - navigator.print();

D - document.print();

Answer : A

Explanation

window.print(); is the correct option.

Answer : C

Explanation

A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered.

Q 4 - Which built-in method returns the calling string value converted to upper case?

A - toUpperCase()

B - toUpper()

C - changeCase(case)

D - None of the above.

Answer : A

Explanation

toUpperCase() method returns the calling string value converted to upper case.

Q 5 - Which of the following function of String object returns the character at the specified index?

A - charAt()

B - charCodeAt()

C - concat()

D - indexOf()

Answer : A

Explanation

charAt() − Returns the character at the specified index.

Q 6 - Which of the following function of String object splits a String object into an array of strings by separating the string into substrings?

A - slice()

B - split()

C - replace()

D - search()

Answer : B

Explanation

split() − Splits a String object into an array of strings by separating the string into substrings.

Q 7 - Which of the following function of String object returns the calling string value converted to lower case?

A - toLocaleLowerCase()

B - toLowerCase()

C - toString()

D - substring()

Answer : B

Explanation

toLowerCase() − Returns the calling string value converted to lower case.

Q 8 - Which of the following function of String object causes a string to be displayed as a subscript, as if it were in a <sub> tag?

A - sup()

B - small()

C - strike()

D - sub()

Answer : D

Explanation

sub() − Causes a string to be displayed as a subscript, as if it were in a <sub> tag.

Q 9 - Which of the following function of Array object returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found?

A - indexOf()

B - join()

C - lastIndexOf()

D - map()

Answer : C

Explanation

lastIndexOf() − Returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found.

Q 10 - Which of the following function of Array object removes the first element from an array and returns that element?

A - reverse()

B - shift()

C - slice()

D - some()

Answer : B

Explanation

shift() − Removes the first element from an array and returns that element.

javascript_questions_answers.htm
Advertisements