Blog

Regular Expression Examples

One of the things that I love about string manipulation is the existence of regular expressions. For this reason, I have decided to share a few examples that may help those who are learning about regular expressions so that can understand them a bit better. JavaScript – General Variable Name Read more…

By Chris West, ago
Blog

JavaScript – indexOf Iterator Via A Generator

Yesterday, I posted about creating String.prototype.indexOfIter() which basically returned a function which would act as an iterator function, indicating the indices of the specified substring. What I neglected to include was how to write this solution using JavaScript 1.7 in FireFox. Today, I bring to you the equivalent using a Read more…

By Chris West, ago
Blog

JavaScript – indexOf Iterator

One of the cool things about JavaScript 1.7 is the fact that it supports generator functions. Unfortunately, not all browsers support generator functions yet. Therefore, when creating iterators we can look to an interesting alternative: closures. For example, if our goal was to make a String prototype function which would Read more…

By Chris West, ago
Blog

Quick JavaScript Encryption Method

Recently, I have been interested in creating a quick one-way encryption method. After playing around with a lot of different variations, I settled on the following: One nice thing about this function is the fact that you can restrict the encrypted message to a certain length. Another interesting thing is Read more…

By Chris West, ago