美文网首页
数组调整顺序

数组调整顺序

作者: friendshi洛初Udo邭 | 来源:发表于2018-12-11 07:29 被阅读0次

    var arr =[

    {

    "itsystemid":968263,

    "Id":363,

    "pp":000,

    "name":"zhangsan"

        },

    {

    "itsystemid":968237,

    "Id":365,

    "pp":1111000,

    "name":"ewqewqewqzhangsan"

        },

    {

    "itsystemid":968237,

    "Id":6978411,

    "pp":12312413000,

    "name":"WEWQzhangsan"

        },

    {

    "itsystemid":968237,

    "Id":6978415,

    "pp":000,

    "name":"zhangsanEEEEEEEEE"

        }

    ]

    var arr1 = [];

    for(var i=0;i

    arr1.push({"Id":arr[i].Id,"itsystemid":arr[i].itsystemid,"name":arr[i].name,"pp":arr[i].pp})

    }

    console.log(arr1);//{Id: 363, itsystemid: 968263, name: "zhangsan", pp: 0}

    // {Id: 365, itsystemid: 968237, name: "ewqewqewqzhangsan", pp: 1111000}

    //{Id: 6978411, itsystemid: 968237, name: "WEWQzhangsan", pp: 12312413000}

    //{Id: 6978415, itsystemid: 968237, name: "zhangsanEEEEEEEEE", pp: 0}

    相关文章

      网友评论

          本文标题:数组调整顺序

          本文链接:https://www.haomeiwen.com/subject/wtalhqtx.html