Skip to content

Instantly share code, notes, and snippets.

@zabirauf
Created July 4, 2017 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zabirauf/e2747d439b9ef5f8be954d807a412cf2 to your computer and use it in GitHub Desktop.
Save zabirauf/e2747d439b9ef5f8be954d807a412cf2 to your computer and use it in GitHub Desktop.
function append(arrOrNum, toAppendArrOrNum) {
if (!Array.isArray(arrOrNum)) {
arrOrNum = [arrOrNum];
}
if (!Array.isArray(toAppendArrOrNum)) {
toAppendArrOrNum = [toAppendArrOrNum];
}
return arrOrNum.concat(toAppendArrOrNum);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment