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

Q 2 - Can you assign a anonymous function to a variable?

A - true

B - false

Answer : A

Explanation

Yes! An anonymous function can be assigned to a variable.

Q 3 - Which built-in method returns the character at the specified index?

A - characterAt()

B - getCharAt()

C - charAt()

D - None of the above.

Answer : C

Explanation

charAt() method returns the character at the specified index.

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 combines the text of two strings and returns a new string?

A - add()

B - merge()

C - concat()

D - append()

Answer : C

Explanation

concat() − Combines the text of two strings and returns a new string.

Q 6 - Which of the following function of String object returns the index within the calling String object of the last occurrence of the specified value?

A - lastIndexOf()

B - search()

C - substr()

D - indexOf()

Answer : A

Explanation

lastIndexOf() − Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found.

Q 7 - Which of the following function of String object creates an HTML anchor that is used as a hypertext target?

A - anchor()

B - link()

C - blink()

D - big()

Answer : A

Explanation

anchor() − Creates an HTML anchor that is used as a hypertext target.

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

A - link()

B - small()

C - sup()

D - sub()

Answer : B

Explanation

small() − Causes a string to be displayed in a small font, as if it were in a <small> 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 returns a string representing the array and its elements?

A - toSource()

B - sort()

C - splice()

D - toString()

Answer : D

Explanation

toString() − Returns a string representing the array and its elements.

javascript_questions_answers.htm
Advertisements