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 - Can you assign a anonymous function to a variable?

A - true

B - false

Answer : A

Explanation

Yes! An anonymous function can be assigned to a variable.

Q 3 - Which built-in method returns the character at the specified index?

A - characterAt()

B - getCharAt()

C - charAt()

D - None of the above.

Answer : C

Explanation

charAt() method returns the character at the specified index.

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 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 returns the calling string value converted to lower case while respecting the current locale?

A - toLocaleLowerCase()

B - toLowerCase()

C - toString()

D - substring()

Answer : A

Explanation

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

Q 8 - Which of the following function of String object creates an HTML hypertext link that requests another URL?

A - link()

B - sub()

C - sup()

D - small()

Answer : A

Explanation

link() − Creates an HTML hypertext link that requests another URL.

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