Created
June 30, 2016 01:43
-
-
Save imaginate/c6fc6ea5bec7c9657b893f2a71cd2f58 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
/** | |
* A method to concat strings to avoid [plus overloading errors](http://www.crockford.com/javascript/javascript.html). | |
* | |
* @param {...*} val | |
* @return {string} | |
*/ | |
function concatString(val) { | |
/** @type {string} */ | |
var str; | |
/** @type {number} */ | |
var len; | |
/** @type {number} */ | |
var i; | |
str = ''; | |
len = arguments.length; | |
i = -1; | |
while (++i) { | |
str += arguments[i]; | |
} | |
return str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment