freecodecamp.cn icon indicating copy to clipboard operation
freecodecamp.cn copied to clipboard

Nesting For Loops

Open YangPengFe1 opened this issue 9 years ago • 0 comments

Challenge Nesting For Loops has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function multiplyAll(arr) {
  var product = 1;
  // 请把你的代码写在这条注释以下
  
  for (var i = 0; i < arr.length; i++){
  
    for (var k = 0; i < arr[i].length; k++){
      
      product *= arr[i][k] ;

    }
  
  }  
  // 请把你的代码写在这条注释以上
  return product;
}

// 你可以修改这一行来测试你的代码
multiplyAll([[1,2],[3,4],[5,6,7]]);


YangPengFe1 avatar Jul 06 '17 08:07 YangPengFe1