Last active
October 12, 2015 18:31
-
-
Save sarfraznawaz2005/f18ec9079c2343ecfb2f to your computer and use it in GitHub Desktop.
Concatenate
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 concatenate(){ | |
// return arguments.join(''); // won't work. arguments is not a real array. | |
// return [].splice.call(arguments,0).join(''); // old 'n busted | |
return Array.prototype.join.call(arguments,''); // new hotness | |
} | |
concatenate('good',2,'go'); | |
// ==> 'good2go' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment