Moving object's key and value to like [{x:key1,y:value1},{x:key2,y:value2}, …]

后端 未结 0 1535
一向
一向 2020-12-09 16:28

\'\'\' let obj = {a:1,b:2,c:3 ...} \'\'\' I want to switch this object\'s keys and values to like \'\'\' obj2=[{x:\'a\', y:1},{x:\'b\', y:2},{x:\'c\',y:3},...] \'\'\' I had

相关标签:
回答
  • 消灭零回复
提交回复
热议问题