Blog

EcmaScript 6 – String.prototype.repeat()

One simple function that is on the roster to be released in EcmaScript 6 is String.prototype.repeat. The following can be used to define it in browsers which don’t currently have it defined natively: Here are some examples of using this function (modified from the originals found on MDN): There is Read more…

By Chris West, ago
Blog

JavaScript – Indenting Text

One thing I needed to do recently was indent a series of strings with a variable number of tabs or spaces. Thusly, I decided to create the following function which can be used by anyone that would need such a function: The JS annotation pretty much sums up how you Read more…

By Chris West, ago