Quiz
Advanced Arrays
Questions in this quiz (5)
1Which of the following lets us loop over an array?
- Afor loop
- BforEach method
- Cwhile loop
2If we use a for loop to loop through an array, what would the end condition typically be?
- Ai < array.length
- Bi <= array.length
- Ci > array.length
- Di >= array.length
3The forEach method allow you to define parameters for which of the following? (Note: some of them are optional!)
- AThe array you're iterating over
- BThe element itself
- CThe index of that element
4Which of the following accurately reflects how we might represent 2D data?
Example data:
a b c
1 2 3- Avar myData = [['a', 'b' ,'c'], [1, 2, 3]];
- Bvar myData = ['a', 1, 'b', 2, 'c', 3];
- Cvar myData = ['a', 'b', 'c', 1, 2 ,3];
- Dvar myData = ['a', 'b', 'c'] + [1, 2, 3];
5In nested loops, the outer loop will be completed (i.e. iterate over every single item) before the inner loop ever begins.
- ATrue
- BFalse
Information
- Description
- Quiz on Advanced Arrays, created by Code Ramp on 25/04/2018.
- Author
- Code Ramp
- Language
- English
- Views
- 308
- Tags
- Rating
- No ratings yet Rate this quiz