• 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

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 returns the index within the calling String object of the first occurrence of the specified value?

A - getIndex()

B - location()

C - indexOf()

D - None of the above.

Answer : C

Explanation

indexOf() method returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.

Q 4 - Which built-in method returns the calling string value converted to upper case?

A - toUpperCase()

B - toUpper()

C - changeCase(case)

D - None of the above.

Answer : A

Explanation

toUpperCase() method returns the calling string value converted to upper case.

Q 5 - Which of the following function of Number object returns the number's value?

A - toString()

B - valueOf()

C - toLocaleString()

D - toPrecision()

Answer : B

Explanation

valueOf() − Returns the number's value.

Q 6 - Which of the following function of String object returns the characters in a string between two indexes into the string?

A - slice()

B - split()

C - substr()

D - substring()

Answer : D

Explanation

substring() − Returns the characters in a string between two indexes into the string.

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 displayed as a superscript, as if it were in a <sup> tag?

A - sup()

B - small()

C - strike()

D - sub()

Answer : A

Explanation

sup() − Causes a string to be displayed as a superscript, as if it were in a <sup> tag.

Q 9 - Which of the following function of Array object calls a function for each element in the array?

A - concat()

B - every()

C - filter()

D - forEach()

Answer : D

Explanation

forEach() − Calls a function for each element in the array.

Q 10 - Which of the following function of Array object adds one or more elements to the front of an array and returns the new length of the array?

A - unshift()

B - sort()

C - splice()

D - toString()

Answer : A

Explanation

unshift() − Adds one or more elements to the front of an array and returns the new length of the array.

javascript_questions_answers.htm
Advertisements