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

Answer : C

Explanation

Both of the above options are correct.

Answer : D

Explanation

window.location='http://www.newlocation.com'; is the correct option.

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 - All user-defined objects and built-in objects are descendants of an object called Object?

A - true

B - false

Answer : A

Explanation

All user-defined objects and built-in objects are descendants of an object called Object.

Q 5 - Which of the following function of Number object defines how many total digits to display of a number?

A - toExponential()

B - toFixed()

C - toLocaleString()

D - toPrecision()

Answer : D

Explanation

toPrecision() − Defines how many total digits (including digits to the left and right of the decimal) to display of a number.

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 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 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 applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value?

A - pop()

B - push()

C - reduce()

D - reduceRight()

Answer : D

Explanation

reduceRight() − Applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value.

javascript_questions_answers.htm
Advertisements