ITEC 102 FINAL TERM Quiz No 1
ITEC 102 FINAL TERM Quiz No 1
ITEC 102 FINAL TERM Quiz No 1
index 0
The methods used to fill the specified static values by modifying original values in the given array.
fill()
Array Literal
The includes() method returns the first index (position) of a specified value.
False
concat()
unshift()
False
An array that can be created using the new keyword which passing arguments in a constructor.
Array Constructor
The every() method returns true if the function returns false for all elements.
False
True
The methods used to combine the array elements into the string and provides a new string.
join()
The concat() method returns a new array, containing the joined arrays.
True
Array Directly
It defines as an ordered list of values and also a container object that holds a fixed number of values of a
single type.
array
pop()
Each item in an array is called an _____________ that can be accessed by its numerical index.
element
An array is used to store a collection set, but it is often more helpful to consider an array as a set of the
same type of variables.
True
push()
False
The forEach () method is used to invoke the function for each array element.
True
new keyword
The _______________ of an array is established when the array is created. After creation, it is fixed.
length
var x = [1,3,5,8,2,-5,-8];
var temp = x[x.length-1];
x[x.length-1] = x[0];
x[0] = temp;
console.log(x);
[-8,3,5,8,2,-5,1]
var x = [];
for(var i = 0; i<10; i++) {
x.push(i*2);
}
console.log(x);
[0,2,4,6,8,10,12,14,16,18]
var x = [2,4,5];
var counter = 0;
if(x[counter] > 0) {
console.log("coding");
counter = counter + 1;
}
if(x[counter] > 0) {
console.log("coding");
counter = counter + 1;
}
if(x[counter] > 0) {
console.log("coding");
counter = counter + 1;
}
console.log(x);
console.log(counter);
coding,coding,coding,[2,4,5],3
var x = [1,3,5];
x.push(2);
x.pop();
console.log(x);
[1,3,5]