Created
May 29, 2013 10:25
-
-
Save eces/5669361 to your computer and use it in GitHub Desktop.
This is an implementation of http://stackoverflow.com/a/4673436/1258486 for CoffeeScript.
This file contains 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
if String.prototype.format is undefined | |
String.prototype.format = () -> | |
_arguments = arguments | |
this.replace /{(\d+)}/g, (match, number) -> | |
if typeof _arguments[number] isnt 'undefined' then _arguments[number] else match |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment