• 合并数组对象


            var obj1 = [{
                "id": 980550455852,
                "model": "XQG70-S1208FW",
                "color": "白",
                "invStatusName": "正品",
                "bactualQty": 10947,
                "brealyQty": 11000,
                "bavailQty": 53
            }, {
                "id": 980550566221,
                "model": "XQB70-C3006",
                "color": "灰",
                "invStatusName": "正品",
                "bactualQty": 11,
                "brealyQty": 6,
                "bavailQty": -5
            }];
    
            var obj2 = [{
                "price": "6666",
                "age":2222
            }, {
                "price": "8888",
                "age":999
            }];
            var obj = obj1.map((item, index) => {
                return {
                    ...item,
                    ...obj2[index]
                };
            });
            console.log(obj);

  • 相关阅读:
    Xaml下
    Xmal
    ItemTemplate
    spring aop
    Struts2
    jsp的标签库
    数据库连接池
    request初探
    kubectl 命令大全
    win10常见问题归总
  • 原文地址:https://www.cnblogs.com/123poi/p/14821026.html
Copyright © 2020-2023  润新知