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 calls a function for each element in the array?

A - while()

B - loop()

C - forEach()

D - None of the above.

Answer : C

Explanation

forEach() method calls a function for each element in the array.

Q 4 - Which built-in method returns the characters in a string beginning at the specified location?

A - substr()

B - getSubstring()

C - slice()

D - None of the above.

Answer : A

Explanation

substr() method returns the characters in a string beginning at the specified location through the specified number of characters.

Q 5 - Which of the following function of Number object returns a string value version of the current number in a format that may vary according to a browser's locale settings.?

A - toExponential()

B - toFixed()

C - toLocaleString()

D - toString()

Answer : C

Explanation

toLocaleString() − Returns a string value version of the current number in a format that may vary according to a browser's locale settings.

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 creates a string to be displayed as bold as if it were in a <b> tag?

A - anchor()

B - big()

C - blink()

D - bold()

Answer : D

Explanation

bold() − Creates a string to be displayed as bold as if it were in a <b> tag.

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

A - fixed()

B - fontcolor()

C - fontsize()

D - italics()

Answer : D

Explanation

italics() − Causes a string to be italic, as if it were in an <i> 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 adds and/or removes elements from an array?

A - toSource()

B - sort()

C - splice()

D - unshift()

Answer : C

Explanation

splice() − Adds and/or removes elements from an array.

javascript_questions_answers.htm
Advertisements