Skip to content

Commit 87be2a3

Browse files
committed
Brainstorm on: Bonus Iteration ironhack-labs#8
1 parent 31da52f commit 87be2a3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/functions-and-arrays.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,22 @@ const matrix = [
191191
[1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]
192192
];
193193

194-
function greatestProduct() {
195-
194+
function greatestProduct(matrix) {}
195+
196+
// get the sum
197+
console.log( matrix[0][0] + matrix[0][0+1] + matrix[0][0+2] + matrix[0][0+3] ) // row
198+
console.log( matrix[0][0] + matrix[0+1][0] + matrix[0+2][0] + matrix[0+3][0] ) // col
199+
200+
// access row / col
201+
console.log( matrix.length ); // row
202+
console.log( matrix[0].length ); // col
203+
204+
// loop row / col
205+
for ( let row of matrix[0] ) {
206+
console.log( row );
207+
}
208+
for ( let col of matrix ) {
209+
console.log( col[0] );
196210
}
197211

198212

0 commit comments

Comments
 (0)