我有这个对象数组
[{
"A": "thisA",
"B": "thisB",
"C": "thisC"
}, {
"A": "thatA",
"B": "thatB",
"C": "thatC"
}]
我试图得到这种格式作为最终结果:[["thisA","thisB","thisC"], ["thatA","thisB","thatC"]]
我知道我们可以使用带有特定键(A、B、C)的 map() 函数。
newarray = array.map(d => [d['A'], d['B'], d['C']])
但是我需要一个通用的函数来传递它而不使用密钥,因为数组的内容会不同,密钥也会不同。有什么好的解决办法吗?