Created
November 16, 2017 21:24
-
-
Save bcls/d9c7bb80818f47b06d800fda8823016a to your computer and use it in GitHub Desktop.
Append array to another array #javascript
This file contains 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
/** | |
* Add one array to another | |
* @param {Array} a The array to add another array to | |
* @param {Array} b The array to add to array a | |
* @return {Array} Array a with b appended to it | |
*/ | |
function combineArrays(a, b) { | |
a.push.apply(a, b); | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment