• 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 1 - Can you access Cookie using javascript?

A - true

B - false

Answer : A

Explanation

Yes! JavaScript can also manipulate cookies using the cookie property of the Document object.

Q 2 - Which of the following is a valid type of function javascript supports?

A - named function

B - anonymous function

C - Both of the above.

D - None of the above.

Answer : C

Explanation

A function in JavaScript can be either named or anonymous.

Answer : C

Explanation

A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered.

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

A - substr()

B - search()

C - lastIndexOf()

D - indexOf()

Answer : D

Explanation

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

Q 7 - Which of the following function of String object returns a string representing the specified object?

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - substring()

Answer : C

Explanation

toString() − Returns a string representing the specified object.

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