如何将此变量中的“标题”和“名字”值打印到 div 中?
var relationshipList = [
{ name: 'William Cotterll', firstname: 'William', title: 'EVP Solutions' },
{ name: 'Edwin Van Der Saar', firstname: 'Edwin', title: 'Security Specialist' },
{ name: 'Kelly Woodson', firstname: 'Kelly', title: 'Production Manager'},
];
编辑:
如果我想打印出 'firstname' 值,当我已经知道 'title' 值时,我该如何实现呢?
例如,我只想在 title == 'EVP Solutions' 时打印 firstname。