map有问题好久了也没见修复,res一直是空数组

阅读次数 45

const todayCustomers = Application.Sheets("todayCustomers") const data = todayCustomers.Record.GetRecords().records const res = data.map(x=>x) console.log(res)
res一直是空数组
使用的是数据表

2 Answers

还有filter等等函数

可以先通过Array.from包装从表格数据中获取的数组对象,然后再进行map,filter等调用。

const data = todayCustomers.Record.GetRecords().records
data = Array.from(data)
const res = data.map(x=>x)