NEW
Font size
WorksheetsJavascript Arrays
Total questions: 18
Worksheet time: 17mins
What is first index value of an array?
-1
0
1
undefine
What is the length of this array?
Which definition below best describe an array?
An array is a function identifier that can hold more than one parameter.
An array is a beam of light.
An array is a special variable, which can hold more than one value at a time.
An array is a special function, which can hold more than one value at a time.
What is proper syntax for declaring a array in JavaScript?
var arrayName =[ ];
var arrayName[ ] ={ };
array arrayName ={ };
obj var arrayName =[ ];
Which of the variables below is an array?
var names="array"
var names = array;
var names = [];
var names[];
What will be the output to the console for the following code:
var colors =["Red", "Green", "Yellow", "Orange", "Blue"];
colors.splice(0,3, "Purple");
console.log(colors);
["Purple", "Green", "Yellow"]
["Purple", "Green", "Yellow", "Orange", "Blue"]
["Red", "Green", "Yellow", "Orange", "Blue"]
["Purple", "Orange", "Blue"]
What is the highest position in this array?
HINT: Remember arrays start at position 0!
arr = [1,2,3,4,5];
What would the array look like after we execute this?:
array.splice(0, 1);
The length() method for an array will return _____.
the number of elements in the array
the last index value of the array.
the length of the name of the array variable
the capacity of the array
The push() method adds a new element to the end of an array
true
false
