JavaScript Array MCQ Questions & Answer

Javascript (JS) Array MCQs : This section focuses on the "Javascript Array". These Multiple Choice Questions (MCQs) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. An _______ is a special variable, which can hold more than one value

A. string
B. integer
C. character
D. array

View Answer


2. It is a common practice to declare arrays with the _________ keyword.

A. var
B. let
C. const
D. none of the above

View Answer


3. Spaces and line breaks are not important.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


4. Array indexes start with ______.

A. -1
B. 0
C. 1
D. Can not say

View Answer


5. The ________ operator in JavaScript returns "object" for arrays.

A. and
B. or
C. not
D. typeof

View Answer


6. What is true about Arrays?

A. JavaScript does not support associative arrays
B. You should use objects when you want the element names to be strings
C. You should use arrays when you want the element names to be numbers
D. All of the above

View Answer


7. The easiest way to add a new element to an array is using the _________ method

A. add()
B. insert()
C. push()
D. set()

View Answer


8. The _______ method also joins all array elements into a string.

A. toString()
B. join()
C. pop()
D. shift()

View Answer


9. Array elements can be deleted using the JavaScript operator?

A. pop
B. shift
C. delete
D. All of the above

View Answer


10. arrays always use numbered indexes.

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer






Discussion



* You must be logged in to add comment.