Created
January 13, 2011 04:45
-
-
Save yuanchuan/777411 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 new_array(/* length */ len, /* default */ value) { | |
var len = ~~len; | |
return value | |
? new Array ( len + 1 ).join( value ).split( '' ) | |
: new Array ( len ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment