Put the functons countRows and countColumns outside of the function gridSize
Challenge #2 does not produce the correct result: SOLVED
paradisefish
#24
One problem that I had was I solved the code a while ago but I didnât delete the code from Challenge 1 so it wouldnât take the answer.
Just in case anyone else didnât delete the countRows function. The answer is actually really simple.
ralbern
#25
Thanks for your input. I put countRows() and countColumns() outside of girdSize() function and its still not working on LHL but in the browser console it gives the correct response.
rdomond
#27
Hi
do you see something wrong with the code below
function countColumns(){
var rows = 10;
var col = 10;
var GRID = [];
var nbCol = [];
var colomns = 0;
for (var j = 0; j < rows; j++){
GRID[j] = j;
for (var i = 0; i < col; i++){
nbCol[i] = GRID[0][i];
}
}
//colomns = nbCol.length * GRID.length;
colomns = GRID.length * nbCol.length;
return colomns;
strong text