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

Explanation

All of the above options are correct.

Answer : D

Explanation

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

Q 3 - Which of the following type of variable is visible only within a function where it is defined?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : B

Explanation

Local Variables: A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.

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 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 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 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 returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found?

A - indexOf()

B - join()

C - lastIndexOf()

D - map()

Answer : A

Explanation

indexOf() − Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found.

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