Skip to content

Commit 578d90c

Browse files
committed
Add missing function declaration and export
1 parent e3edebb commit 578d90c

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/functions-and-arrays.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,38 @@
22
function maxOfTwoNumbers() {}
33

44

5+
56
// Iteration #2: Find longest word
7+
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
68

79
function findLongestWord() {}
810

9-
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
1011

11-
// Iteration #3: Calculate the sum
1212

13+
// Iteration #3: Calculate the sum
1314
const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10];
1415

1516
function sumNumbers() {}
1617

18+
19+
20+
// Iteration #3.1 Bonus:
21+
function sum() {}
22+
23+
24+
1725
// Iteration #4: Calculate the average
1826
// Level 1: Array of numbers
1927
const numbersAvg = [2, 6, 9, 10, 7, 4, 1, 9];
2028

2129
function averageNumbers() {}
2230

31+
2332
// Level 2: Array of strings
2433
const wordsArr = ['seat', 'correspond', 'linen', 'motif', 'hole', 'smell', 'smart', 'chaos', 'fuel', 'palace'];
2534

35+
36+
2637
// Iteration #5: Unique arrays
2738
const wordsUnique = [
2839
'crab',
@@ -40,11 +51,15 @@ const wordsUnique = [
4051

4152
function uniquifyArray() {}
4253

54+
55+
4356
// Iteration #6: Find elements
4457
const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience'];
4558

4659
function doesWordExist() {}
4760

61+
62+
4863
// Iteration #7: Count repetition
4964
const wordsCount = [
5065
'machine',
@@ -62,8 +77,9 @@ const wordsCount = [
6277

6378
function howManyTimes() {}
6479

65-
// Iteration #8: Bonus
6680

81+
82+
// Iteration #8: Bonus
6783
const matrix = [
6884
[8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
6985
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
@@ -89,12 +105,17 @@ const matrix = [
89105

90106
function greatestProduct() {}
91107

92-
// The following is required to make unit tests work. Please ignore it.
108+
109+
110+
111+
// The following is required to make unit tests work.
112+
/* Environment setup. Do not modify the below code. */
93113
if (typeof module !== 'undefined') {
94114
module.exports = {
95115
maxOfTwoNumbers,
96116
findLongestWord,
97117
sumNumbers,
118+
sum,
98119
averageNumbers,
99120
uniquifyArray,
100121
doesWordExist,

0 commit comments

Comments
 (0)