Why do I get "undefined"?

function sc(apple){
    for(var i = 0; i < apple.lenght; i++){
    for(var j = 0; j < apple[i].length; j++){
      if (apple[i][j]==="B"){var result=[i,j];}}}
     return result}

are you sure this is what you wanted to write?

1 Like

oh my god! thanks!!!