Last active
August 23, 2018 01:12
-
-
Save luislobo14rap/cf26d64299f742a190d9849b611f6e9b 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
// arrayMerge.js v1 | |
function arrayMerge(arrayA, arrayB) { | |
let newArray = []; | |
for (let i = 0; i < arrayA.length; i++) { | |
newArray.push(arrayA[i]); | |
}; | |
for (let i = 0; i < arrayB.length; i++) { | |
newArray.push(arrayB[i]); | |
}; | |
return newArray; | |
}; | |
Array.prototype.merge = function(arrayB) { | |
return arrayMerge(this, arrayB); | |
}; |
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
// arrayMerge.min.js v1 | |
function arrayMerge(a,b){let c=[];for(let d=0;d<a.length;d++)c.push(a[d]);for(let d=0;d<b.length;d++)c.push(b[d]);return c}Array.prototype.merge=function(a){return arrayMerge(this,a)}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment