forked from WebProgrammingII/WEPO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arrays_examples.js
43 lines (23 loc) · 976 Bytes
/
arrays_examples.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
Array examples
*/
/* Basic methods */
// 1. Join an array with -
// 2. Reverse an array
// 3. Sort an array
// 4. Sort an array with a reverse sort function
// 5. Use concat with empty array and three params
// 6. Use concat with array and then comma-separated params
/* More advanced methods */
// 1. Map a square function
// 2. Map a function which takes an array of lowercase brands and makes all uppercase
// 3. Filter a function for valid SSN with the correct length
// 4. Filter all odd numbers which are larger than 5
// 5. Evaluate if every element are a typeof function (should pass)
// 6. Evaluate if every element is larger than 10
// 7. Evaluate if some elements are squared equal to 4
// 8. Reduce all elements and calculate the average
// 9. Reduce a reversed string
// 10. Use indexOf to find a specific element within an array
// 10.1. integer
// 10.2. object