我对这些ES6 array.prototype方法有点坚持,并不真正知道如何正确实施。目标是映射以下对象(假设它被称为attribues)并将attribute_label值放入一个新数组中。检查此值以避免空值也很重要。结果应该是一个新数组,其中包含字符串值:
{
"size": {
"attribute_label": "Size",
"code": null
},
"color": {
"attribute_label": "Color",
"code": 24
},
"material": {
"attribute_label": "Material",
"code": null
}
}