Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a71bba

Browse files
committed
Replaced some var's
1 parent 81f3b3d commit 7a71bba

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Week3/homework-solutions/5-step3.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22

3-
// note: prefer const and let over var
3+
// note: prefer const and let over let
44
function multiplyAll(arr) {
5-
var product = 1;
6-
for (var i = 0; i < arr.length; i++) {
7-
var innerArray = arr[i];
8-
for (var j = 0; j < innerArray.length; j++) {
5+
let product = 1;
6+
for (let i = 0; i < arr.length; i++) {
7+
const innerArray = arr[i];
8+
for (let j = 0; j < innerArray.length; j++) {
99
product *= innerArray[j];
1010
}
1111
}

Week3/homework-solutions/6-step3.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const printArray2d = printArray;
1717
const printArray3d = printArray;
1818

1919
printArray2d(arr2d);
20-
2120
printArray3d(arr3d);
2221

2322
// Do not change or remove the next lines

0 commit comments

Comments
 (0)