Podcast
Questions and Answers
What is the index of the first element in an array?
What is the index of the first element in an array?
- 1
- 0 (correct)
- -1
- None of the above
What is the purpose of the Array object when declaring an array?
What is the purpose of the Array object when declaring an array?
- To create an array with a specific data type
- To initialize an empty array
- To create a multidimensional array
- To specify the length of the array (correct)
What is the difference between var a_ary = ['a', 'b', 'c']; and var a_ary = new Array('a', 'b', 'c');?
What is the difference between var a_ary = ['a', 'b', 'c']; and var a_ary = new Array('a', 'b', 'c');?
- The first one creates an array, the second one creates a string
- The first one creates a string, the second one creates an array
- There is no difference, both create an array (correct)
- The first one creates a sparse array, the second one creates a dense array
What is the output of console.log(a_ary.length);?
What is the output of console.log(a_ary.length);?
What is the purpose of the length property of an array?
What is the purpose of the length property of an array?
What happens when you use Array.prototype.unshift() on an array?
What happens when you use Array.prototype.unshift() on an array?
What is the difference between Array.prototype.shift() and Array.prototype.pop()?
What is the difference between Array.prototype.shift() and Array.prototype.pop()?
What is the purpose of the Array.prototype.splice() method?
What is the purpose of the Array.prototype.splice() method?
What is the return value of the Array.prototype.shift() method?
What is the return value of the Array.prototype.shift() method?
What happens when you use Array.prototype.push() on an array?
What happens when you use Array.prototype.push() on an array?
Flashcards are hidden until you start studying