Javascript Online Quiz


Advertisements

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

Answer : C

Explanation

Both of the above options are correct.

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.

Q 3 - Which built-in method returns the length of the string?

A - length()

B - size()

C - index()

D - None of the above.

Answer : A

Explanation

length() method returns the length of the string.

Q 4 - All user-defined objects and built-in objects are descendants of an object called Object?

A - true

B - false

Answer : A

Explanation

All user-defined objects and built-in objects are descendants of an object called Object.

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 extracts a section of a string and returns a new string?

A - slice()

B - split()

C - replace()

D - search()

Answer : A

Explanation

slice() − Extracts a section of a string and returns a new string.

Q 7 - Which of the following function of String object returns a string representing the specified object?

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - substring()

Answer : C

Explanation

toString() − Returns a string representing the specified object.

Q 8 - Which of the following function of Array object returns a new array comprised of this array joined with other array(s) and/or value(s)?

A - concat()

B - pop()

C - push()

D - some()

Answer : A

Explanation

concat() − Returns a new array comprised of this array joined with other array(s) and/or value(s).

Q 9 - Which of the following function of Array object creates a new array with all of the elements of this array for which the provided filtering function returns true?

A - concat()

B - every()

C - filter()

D - some()

Answer : C

Explanation

filter() − Creates a new array with all of the elements of this array for which the provided filtering function returns true.

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