String.prototype.repeat

David Bruant david.bruant at labri.fr
Tue Mar 22 13:42:07 PDT 2011


Hi,

About the string_repeat strawman
(http://wiki.ecmascript.org/doku.php?id=strawman:string_repeat), one
alternative solution could be a two argument constructor. Something
like: String(n, pattern). So, for the example in the strawman, it would
be String(3, '*').
In ES5, the String constructors (String and new String) both are
expected to be used with zero or one argument, so using a two argument
constructor should not break the web or people's expectations.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110322/21f279bc/attachment.html>


More information about the es-discuss mailing list