📜  从数组打字稿代码示例中选择列值

📅  最后修改于: 2022-03-11 14:48:31.499000             🧑  作者: Mango

代码示例1
var result1 = [
    {id:1, name:'Sandra', type:'user', username:'sandra'},
    {id:2, name:'John', type:'admin', username:'johnny2'},
    {id:3, name:'Peter', type:'user', username:'pete'},
    {id:4, name:'Bobby', type:'user', username:'be_bob'}];
    
 
var data = result1.map(t=>t.name);
console.log(data);