Я новичок в дартс. Ниже приведен массив, и мне нужно получить доступ к конкретному элементу
'text': 'Rabbit'
и 'score': 3
Я попробовал следующее:
_questions[1]['answers'][0]['text']['score']
Это не работает.
var _questions = [
{
'question': 'What is your color?',
'answers': [
{'text': 'Black', 'score': 10},
{'text': 'Red', 'score': 5},
{'text': 'Green', 'score': 3},
{'text': 'White', 'score': 1},
],
},
{
'question': 'What is your animal?',
'answers': [
{'text': 'Rabbit', 'score': 3},
{'text': 'Snake', 'score': 11},
{'text': 'Elephant', 'score': 5},
{'text': 'Lion', 'score': 9},
],
},
];