当前结果:

主数据:[object Object]

用stringify:

[{"bundlingId":"10547","countqtybuy":1},
 {"bundlingId":"19386","countqtybuy":2}]


使用toString:[object Object]

使用toString + stringify:

[{"bundlingId":"10547","countqtybuy":1},
 {"bundlingId":"19386","countqtybuy":2}]


我的预期结果:

10547,1;19386,2

最佳答案

由于我发现您的路线不正确,因此我为您发布了此信息



const obj = JSON.parse`[{"bundlingId":"10547","countqtybuy":1},
 {"bundlingId":"19386","countqtybuy":2}]`

 const values = obj.map(item => Object.values(item).join(",")).join(";")
 console.log(values)

09-27 00:07