• 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

Answer : C

Explanation

Both of the above options are correct.

Q 2 - Which of the following type of variable is visible everywhere in your JavaScript code?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : A

Explanation

Global Variables: A global variable has global scope which means it is visible everywhere in your JavaScript code.

Q 3 - Which built-in method removes the last element from an array and returns that element?

A - last()

B - get()

C - pop()

D - None of the above.

Answer : C

Explanation

pop() method removes the last element from an array and returns that element.

Answer : B

Explanation

var book = new Object(); creates an object.

Q 5 - Which of the following function of Boolean object returns a string containing the source of the Boolean object?

A - toSource()

B - valueOf()

C - toString()

D - None of the above.

Answer : A

Explanation

toSource() − Returns a string containing the source of the Boolean object; you can use this string to create an equivalent object.

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 returns the primitive value of the specified object.

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - valueOf()

Answer : D

Explanation

valueOf() − Returns the primitive value of the specified object.

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 removes the last element from an array and returns that element?

A - pop()

B - push()

C - join()

D - map()

Answer : A

Explanation

pop() − Removes the last element from an array and returns that element.

Q 10 - Which of the following function of Array object sorts the elements of an array?

A - toSource()

B - sort()

C - toString()

D - unshift()

Answer : B

Explanation

sort() − Sorts the elements of an array.

javascript_questions_answers.htm
Advertisements