Created
November 28, 2015 21:12
-
-
Save rubeniskov/ed95d48fbf3a47dad187 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function merge(target, source){ | |
if(source !== undefined && (source=isArrayLike(source)?source:[source])) | |
for(var i=0;i<Math.max(target.length, source.length);i++) | |
target.splice(i,1, source[i]||target[i]); | |
return target; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment