var obj = { a: "aaaaaa" };
            var obj1 = { b: "bbbbbb" };
            Object.extend = function (destination, source) {
                for (property in source) {
                    destination[property] = source[property];
                }
                return destination;
            }
            Object.extend(obj, obj1);
            alert(JSON.stringify(obj)); //结果为{"a":"aaaaaa","b":"bbbbbb"}

 

相关文章:

  • 2021-12-03
  • 2021-08-18
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-02-20
  • 2022-12-23
猜你喜欢
  • 2021-11-15
  • 2021-06-22
  • 2021-06-09
  • 2022-03-11
  • 2021-11-10
  • 2022-12-23
相关资源
相似解决方案