Created
April 1, 2017 17:31
-
-
Save lupomontero/23626d917d2a794fb86d467bdcc169bc 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 concat(a, b) { | |
var resultado = []; | |
for (var i = 0; i < a.length; i++) { | |
resultado.push(a[i]); | |
} | |
for (i = 0; i < b.length; i++) { | |
resultado.push(b[i]); | |
} | |
return resultado; | |
} | |
var arr = concat([1, 2, 3], [9, 8, 7]); | |
console.log(arr); // [ 1, 2, 3, 9, 8, 7 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment