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
Blog

Camel Case In JavaScript

Almost a month ago, I posted about creating a camel case function in VBScript. Now I think it is time to see a simple way to implement this function in JavaScript: Believe it or not, that is all the code you will need for the following to work: You will Read more…

By Chris West, ago