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 2 - How can you get the total number of arguments passed to a function?

A - Using args.length property

B - Using arguments.length property

C - Both of the above.

D - None of the above.

Answer : B

Explanation

Using arguments.length property, we can get the total number of arguments passed to a function.

Q 3 - Which of the following type of variable takes precedence over other if names are same?

A - global variable

B - local variable

C - Both of the above.

D - None of the above.

Answer : B

Explanation

A local variable takes precedence over a global variable with the same name.

Q 4 - Which built-in method sorts the elements of an array?

A - changeOrder(order)

B - order()

C - sort()

D - None of the above.

Answer : C

Explanation

sort() method sorts the elements of an array.

Q 5 - Which of the following function of String object returns the character at the specified index?

A - charAt()

B - charCodeAt()

C - concat()

D - indexOf()

Answer : A

Explanation

charAt() − Returns the character at the specified index.

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 the specified color as if it were in a <font color='color'> tag?

A - fixed()

B - fontcolor()

C - blink()

D - bold()

Answer : B

Explanation

fontcolor() − Causes a string to be displayed in the specified color as if it were in a <font color = 'color'> 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 represents the source code of an object?

A - toSource()

B - splice()

C - toString()

D - unshift()

Answer : A

Explanation

toSource() − Represents the source code of an object.

javascript_questions_answers.htm
Advertisements