数组对象里面的值处理

let arr =["rwdm/app","rdmyn/bpp"];

         let arr2 = [];

         let json1={}

         json2={}

         json1={

                   key:arr[0].split("/")[0],

                   value:arr[0].split("/")[1]

         }

         json2={

                   key:arr[1].split("/")[0],

                   value:arr[1].split("/")[1]

         }

         arr2.push(json1,json2)

         console.log(arr2,'arr2')

页面显示的值:

 

posted @ 2018-12-25 16:30  realman?  阅读(804)  评论(0编辑  收藏  举报