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

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

Q 3 - Which built-in method returns the length of the string?

A - length()

B - size()

C - index()

D - None of the above.

Answer : A

Explanation

length() method returns the length of the string.

Q 4 - Which built-in method returns the calling string value converted to lower case?

A - toLowerCase()

B - toLower()

C - changeCase(case)

D - None of the above.

Answer : A

Explanation

toLowerCase() method returns the calling string value converted to lower case.

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 characters in a string beginning at the specified location through the specified number of characters?

A - slice()

B - split()

C - substr()

D - search()

Answer : C

Explanation

substr() − Returns the characters in a string beginning at the specified location through the specified number of characters.

Q 7 - Which of the following function of String object returns the primitive value of the specified object.

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - valueOf()

Answer : D

Explanation

valueOf() − Returns the primitive value of the specified object.

Q 8 - Which of the following function of String object causes a string to be italic, as if it were in an <i> tag?

A - fixed()

B - fontcolor()

C - fontsize()

D - italics()

Answer : D

Explanation

italics() − Causes a string to be italic, as if it were in an <i> 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