• 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 : D

Explanation

All of the above options are correct.

Q 2 - How can you get the type of arguments passed to a function?

A - using typeof operator

B - using getType function

C - Both of the above.

D - None of the above.

Answer : A

Explanation

Using typeof operator, we can get the type of arguments passed to a function.

Q 3 - Which of the following type of variable takes precedence over other if names are same?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : B

Explanation

A local variable takes precedence over a global variable with the same name.

Q 4 - Which of the following function of Number object formats a number with a specific number of digits to the right of the decimal?

A - toExponential()

B - toFixed()

C - toPrecision()

D - toLocaleString()

Answer : B

Explanation

toFixed() − Formats a number with a specific number of digits to the right of the decimal.

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 returns the characters in a string beginning at the specified location through the specified number of characters?

A - slice()

B - split()

C - substr()

D - search()

Answer : C

Explanation

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

Q 7 - Which of the following function of String object returns the calling string value converted to upper case while respecting the current locale?

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - substring()

Answer : A

Explanation

toLocaleUpperCase() − Returns the calling string value converted to upper case while respecting the current locale.

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 true if every element in this array satisfies the provided testing function?

A - concat()

B - every()

C - push()

D - some()

Answer : B

Explanation

every() − Returns true if every element in this array satisfies the provided testing function.

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