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 1 - Can you access Cookie using javascript?

A - true

B - false

Answer : A

Explanation

Yes! JavaScript can also manipulate cookies using the cookie property of the Document object.

Answer : A

Explanation

document.cookie = 'key1 = value1; key2 = value2; expires = date'; 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.

Answer : B

Explanation

var book = new Object(); creates an object.

Q 5 - Which of the following function of String object combines the text of two strings and returns a new string?

A - add()

B - merge()

C - concat()

D - append()

Answer : C

Explanation

concat() − Combines the text of two strings and returns a new string.

Q 6 - Which of the following function of String object returns the index within the calling String object of the last occurrence of the specified value?

A - lastIndexOf()

B - search()

C - substr()

D - indexOf()

Answer : A

Explanation

lastIndexOf() − Returns the index within the calling String object of the last 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 upper case?

A - toLocaleUpperCase()

B - toUpperCase()

C - toString()

D - substring()

Answer : B

Explanation

toUpperCase() − Returns the calling string value converted to upper case.

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 creates a new array with the results of calling a provided function on every element in this array?

A - push()

B - join()

C - pop()

D - map()

Answer : D

Explanation

map() − Creates a new array with the results of calling a provided function on every element in this array.

Q 10 - Which of the following function of Array object reverses the order of the elements of an array?

A - reverse()

B - push()

C - reduce()

D - reduceRight()

Answer : A

Explanation

reverse() − Reverses the order of the elements of an array.

javascript_questions_answers.htm
Advertisements