Wednesday, December 24, 2008

Quick! way to get repeated characters

want 8 spaces?


(new Array(8)).join(' ')

it's quick not only as in fewer keystrokes/less code, but is also blazingly fast to execute compared to a for-loop implementation.

No comments:

Post a Comment