Closed dickeylth closed 9 years ago
@dickeylth not sure if this should be a functionality for a function like "deep extend", otherwise you are making the function aware about the content of the array.
@dickeylth now it follows jQuery.extend() style, and jQuery do extend arrays like that:
$.extend([1,2,3], [2,3])
Array [ 2, 3, 3 ]
May be it's time to create some custom module without arrays extending.
@dickeylth oh, it's looks like it isn't whole picture, jQuery overwrite arrays if they inside objects:
$.extend({a: [1, 2, 3]}, {a: [2, 3]}).a
Array [ 2, 3 ]
Fixed by 9ea374c54bdff7e42be163ae09670ea8cf3bbc7e
Cool!~Thank you!
It seems that
deep-extend
uses replacement by index in array and concat two arrays, however in my situation I want to override the first array value, how to do that?