You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-164Lines changed: 0 additions & 164 deletions
Original file line number
Diff line number
Diff line change
@@ -398,167 +398,3 @@ var maxProduct = greatestProduct(matrix);
398
398
console.log(maxProduct);
399
399
// => 57,148,146
400
400
```
401
-
402
-
function averageNumbers(array){
403
-
// Your code here
404
-
}
405
-
406
-
var average = averageNumbers(numbers);
407
-
console.log(average);
408
-
// 6
409
-
```
410
-
411
-
### Level 2: Array of Strings
412
-
413
-
Write code to calculate the average *length* of the strings inside of the following array:
414
-
415
-
```javascript
416
-
var words = [
417
-
"seat",
418
-
"correspond",
419
-
"linen",
420
-
"motif",
421
-
"hole",
422
-
"smell",
423
-
"smart",
424
-
"chaos",
425
-
"fuel",
426
-
"palace"
427
-
];
428
-
```
429
-
430
-
**Starter Code**
431
-
432
-
```javascript
433
-
functionaverageWordLength(array){
434
-
// Your code here
435
-
}
436
-
437
-
var averageLength =averageNumbers(words);
438
-
console.log(averageLength);
439
-
// 5.3
440
-
```
441
-
442
-
## Unique Arrays
443
-
444
-
Take the following array, remove the duplicates, and return a new array. You're more than likely going to want to check out the [`indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) function.
Write a function that will take in an array of words as one argument, and a word to search for as the other. Return `true` if it exists, otherwise return `false`. **Don't** use `indexOf` for this one. :)
479
-
480
-
**Starter Code**
481
-
482
-
```javascript
483
-
var words = [
484
-
"machine",
485
-
"subset",
486
-
"trouble",
487
-
"starting",
488
-
"matter",
489
-
"eating",
490
-
"truth",
491
-
"disobedience"
492
-
];
493
-
494
-
var hasMatter =doesWordExist(words, "matter");
495
-
console.log(hasMatter);
496
-
// true
497
-
498
-
var hasDog =doesWordExist(words, "dog");
499
-
console.log(hasDog);
500
-
// false
501
-
```
502
-
503
-
## Counting Repetion
504
-
505
-
Write a function that will take in an array of words as one argument, and a word to search for as the other. The function will return the number of times that word appears in the array.
506
-
507
-
**Starter Code**
508
-
509
-
```javascript
510
-
var words = [
511
-
"machine",
512
-
"matter",
513
-
"subset",
514
-
"trouble",
515
-
"starting",
516
-
"matter",
517
-
"eating",
518
-
"matter",
519
-
"truth",
520
-
"disobedience"
521
-
"matter"
522
-
];
523
-
524
-
var howManyMatter =howManyTimes(words, "matter");
525
-
console.log(howManyMatter);
526
-
// 4
527
-
528
-
var howManyDog =howManyTimes(words, "dog");
529
-
console.log(howManyDog);
530
-
// 0
531
-
```
532
-
533
-
## Bonus Quest
534
-
535
-
In the 20×20 grid below; What is the greatest product of four adjacent numbers in the same direction (up, down, left, right)?
0 commit comments