//my code:
var _index = 0;
var question = [
{
'Questionkey': "which cryptocurrency do you like",
'Answer': ['bitcoin', 'etherium']
},
{
'Questionkey': "and why do you like that?",
'Answer': ['stable', 'acutally i don\'t know ']
},
];
question[_index]['Questionkey']//accessing the question but I am getting error while accessing
//question 是由地圖組成的串列,我想訪問指向 questionkey 鍵的問題
uj5u.com熱心網友回復:
無論您在哪里使用
question[_index]['Questionkey']
寫
question[_index]['Questionkey'] as String
反而。它能夠訪問映射就好了,只是它無法在編譯時確定型別。而且我假設您在需要成為String. 知道它是一個String你可以像這樣安全地投射它
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/522454.html
標籤:扑列表镖目的映射
