Arrays Flashcards
1
Q
How do you create an array?
A
var bucketList = [‘Web Developer’, ‘Girlfriend’, ‘Dog’];
2
Q
If I have a list using an array with what number, would I select the last string, with a list of three strings?
A
[2]
3
Q
How can you find out how many items are inside of an array?
A
console.log(bucketList.length);
4
Q
With a built in function that Javascript has for arrays, how can we add items to the end of an array?
A
bucketList.push(‘item 3’, ‘item 4’);
5
Q
With a built in function that Javascript has for arrays, how can we delete the last item from an array?
A
bucket.pop();