-1

How do I output a certain value which is inside of an array inside of another array? If this doesn't make sense let me demonstrate this

let sports = [
    ['rowing', 'gymnastics'],
    ['martial arts', 'tennis'],
    ['soccer', 'basketball']
]

So what I did was sort sports into categories: individual sports, dual, team. I just simply want to output in the terminal only one of these sports. Therefore what I tried was console.log(sports[1[1]]) In this way I thought that it would select the second array inside of sports (dual sports) and then pick the second item inside of that array (tennis). This resulted in undefined, why is this? and in what way do I output tennis to the terminal then'

1 Answers1

-1

You should provide request like this:

console.log(sports[1][1])
Murat
  • 34
  • 5