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 - 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.

Q 4 - Which built-in method returns the string representation of the number's value?

A - toValue()

B - toNumber()

C - toString()

D - None of the above.

Answer : C

Explanation

toString() method returns the string representation of the number's value.

Q 5 - Which of the following function of Boolean object returns a string of either 'true' or 'false' depending upon the value of the object?

A - toSource()

B - valueOf()

C - toString()

D - None of the above.

Answer : C

Explanation

toString() − Returns a string of either 'true' or 'false' depending upon the value of the object.

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 upper case?

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - substring()

Answer : B

Explanation

toUpperCase() − Returns the calling string value converted to upper case.

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

A - sup()

B - small()

C - strike()

D - sub()

Answer : C

Explanation

strike() − Causes a string to be displayed as struck-out text, as if it were in a <strike> tag.

Q 9 - Which of the following function of Array object returns the first (least) 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 : A

Explanation

indexOf() − Returns the first (least) 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 represents the source code of an object?

A - toSource()

B - splice()

C - toString()

D - unshift()

Answer : A

Explanation

toSource() − Represents the source code of an object.


javascript_questions_answers.htm

Advertisements