我正在嘗試創建一個json數組對象。格式化json數組對象
我的陣列是
var array=[{a:1,b:2,id:apple},{a:5,b:10,id:banana}]
我想輸出它,以便陣列格式:
[{source:apple, target:a ,value:1},{source:apple, target:b ,value:2},{source:banana, target:a ,value:5},{source:banana, target:b ,value:10}]
幫助表示讚賞!
那你試試? – baao