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 - Is JavaScript a case-sensitive language?

A - true

B - false

Answer : A

Explanation

Yes! JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.

Q 2 - Which of the following is a valid type of function javascript supports?

A - named function

B - anonymous function

C - Both of the above.

D - None of the above.

Answer : C

Explanation

A function in JavaScript can be either named or anonymous.

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 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 splits a String object into an array of strings by separating the string into substrings?

A - slice()

B - split()

C - replace()

D - search()

Answer : B

Explanation

split() − Splits a String object into an array of strings by separating the string into substrings.

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 fixed-pitch font as if it were in a <tt> tag?

A - fixed()

B - big()

C - blink()

D - bold()

Answer : A

Explanation

fixed() − Causes a string to be displayed in fixed-pitch font as if it were in a <tt> tag.

Q 9 - Which of the following function of Array object applies a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value?

A - pop()

B - push()

C - reduce()

D - reduceRight()

Answer : C

Explanation

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

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