我有以下 javascript
var wordselection = [
{ 'word': "Pomme", "gender": "m", },
{ "word": "Banane", "gender": "f", },
{ "word": "Ananas", "gender": "m", },
{ "word": "Chat", "gender": "f", },
{ "word": "Chien", "gender": "m", },
{ "word": "Poisson", "gender": "f", },
];
function randomword(){
var chosen = wordselection[Math.floor(Math.random()*wordselection.length)];
document.getElementById("word").innerHTML=chosen;
}
我该如何编码,以便它只显示一个随机的“单词”(例如 pomme、banane、ananas)或“gender”
目前它说 [object Object] (因为它错了)
谢谢