Created
July 4, 2017 02:47
-
-
Save zabirauf/a175781b574df699fa5e8b481e1c59b1 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 append( | |
arrOrNum: number | number[], | |
toAppendArrOrNum: number | number[]): number[] { | |
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