这是读取配置文件并返回数组我希望返回特定元素之类的细节,目前它的返回完整数组我想要简单的细节元素。
const lay = {
key: null,
information: {
time: false,
rate: false
},
details: {
tip: false,
edit: true
}
};
我正在使用
transform() {
return conf.find((d) => {
return d;
});
}
答案 0 :(得分:0)
const lay = {
key: null,
information: {
time: false,
rate: false
},
details: {
tip: false,
edit: true
}
};
let transform = () => lay.details;
transform();
答案 1 :(得分:0)
const lay = {
key: null,
information: {
time: false,
rate: false
},
details: {
tip: false,
edit: true
}
};
function transform() {
return lay.details; //or lay['details']
}