Skip to content

Commit 7717fd5

Browse files
committed
fix styles
1 parent 104d518 commit 7717fd5

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

src/functions-and-arrays.js

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,45 @@
11
// Iteration #1: Find the maximum
22
function maxOfTwoNumbers(aNumber, anotherNumber) {
3-
if(aNumber > anotherNumber){
3+
if (aNumber > anotherNumber) {
44
return aNumber;
55
}
66
return anotherNumber;
77
}
88

9-
10-
119
// Iteration #2: Find longest word
1210
const words = ['mystery', 'brother', 'aviator', 'crocodile', 'pearl', 'orchard', 'crackpot'];
1311

1412
function findLongestWord(input) {
15-
if(!input || input.length == 0){
13+
if (!input || input.length == 0) {
1614
return null;
1715
}
18-
let longestWord = "";
19-
for(word of input){
20-
if(word.length > longestWord.length){
16+
let longestWord = '';
17+
for (word of input) {
18+
if (word.length > longestWord.length) {
2119
longestWord = word;
2220
}
2321
}
2422
return longestWord;
2523
}
2624

27-
28-
2925
// Iteration #3: Calculate the sum
3026
const numbers = [6, 12, 1, 18, 13, 16, 2, 1, 8, 10];
3127

3228
function sumNumbers() {}
3329

34-
35-
3630
// Iteration #3.1 Bonus:
3731
function sum() {}
3832

39-
40-
4133
// Iteration #4: Calculate the average
4234
// Level 1: Array of numbers
4335
const numbersAvg = [2, 6, 9, 10, 7, 4, 1, 9];
4436

4537
function averageNumbers() {}
4638

47-
4839
// Level 2: Array of strings
4940
const wordsArr = ['seat', 'correspond', 'linen', 'motif', 'hole', 'smell', 'smart', 'chaos', 'fuel', 'palace'];
5041

51-
function averageWordLength() { }
42+
function averageWordLength() {}
5243

5344
// Bonus - Iteration #4.1
5445
function avg() {}
@@ -70,15 +61,11 @@ const wordsUnique = [
7061

7162
function uniquifyArray() {}
7263

73-
74-
7564
// Iteration #6: Find elements
7665
const wordsFind = ['machine', 'subset', 'trouble', 'starting', 'matter', 'eating', 'truth', 'disobedience'];
7766

7867
function doesWordExist() {}
7968

80-
81-
8269
// Iteration #7: Count repetition
8370
const wordsCount = [
8471
'machine',
@@ -96,8 +83,6 @@ const wordsCount = [
9683

9784
function howManyTimes() {}
9885

99-
100-
10186
// Iteration #8: Bonus
10287
const matrix = [
10388
[8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
@@ -124,9 +109,6 @@ const matrix = [
124109

125110
function greatestProduct() {}
126111

127-
128-
129-
130112
// The following is required to make unit tests work.
131113
/* Environment setup. Do not modify the below code. */
132114
if (typeof module !== 'undefined') {

0 commit comments

Comments
 (0)