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

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 of the following function of Number object forces a number to display in exponential notation?

A - toExponential()

B - toFixed()

C - toPrecision()

D - toLocaleString()

Answer : A

Explanation

toExponential(): Forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation.

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 extracts a section of a string and returns a new string?

A - slice()

B - split()

C - replace()

D - search()

Answer : A

Explanation

slice() − Extracts a section of a string and returns a new string.

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 in a small font, as if it were in a <small> tag?

A - link()

B - small()

C - sup()

D - sub()

Answer : B

Explanation

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

Q 9 - Which of the following function of Array object joins all elements of an array into a string?

A - concat()

B - join()

C - pop()

D - map()

Answer : B

Explanation

join() − Joins all elements of an array into a string.

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
E-Books Store