angularjs - Getting zero length array on angular merge although original array is of 3 length with 3 elements -
i have array.
var arr=new array(3); var o1={name:vv},o2:{name1:{}}; // dummy data. var obj= angular.merge({},o1,o2);
produces result
obj={ name:[], name1:{} }
my question why array length reduced 0 in merge. not able understand scenario.
part b:
var arr1=[1,2,3,3]; console.log(arr1);
take @ angular.merge docs. believe talks merging objects objects, not arrays, if read first sentence:
deeply extends destination object dst copying own enumerable properties src object(s) dst.
Comments
Post a Comment