Blog

JavaScript – swap

A few weeks ago, while analyzing some of the CSS code for jQuery, I noticed a call to the swap() function. After looking through the definition of the function and reading the reason for using it in the documentation, I realized that this function might be pretty useful for others. Read more…

By Chris West, ago
Blog

JavaScript – Date.now()

One of the newer functions that was added as of the 5th edition of ECMA-262 is Date.now(). This function returns the number of milliseconds that have passed since January 1, 1970 at midnight GMT time (UTC). If you desire to write code that uses this newer function, in order to Read more…

By Chris West, ago
Blog

JavaScript – Primitives & Objects

Purpose of the valueOf() Function Let me start off by explaining the commonly misunderstood valueOf() function. The purpose of this function is to return a primitive which represents the specified object. Why is this necessary? Let’s use the following code to illustrate why: If you were to execute this code, Read more…

By Chris West, ago
Blog

Excel – Coalesce Function?

Unfortunately, after googling for a while, I was unable to find a COALESCE function or something similar that natively exists within Excel. Therefore, I decided to write a quick-and-dirty formula that would approximate it. I used the following array formula to pull the first non-blank value from cells C2 to Read more…

By Chris West, ago
Blog

VBScript – CamelCase Function

One of the things that is often used in the JavaScript Prototype library is the camelize function which camel-cases the specified string. Unfortunately, just as this function doesn’t exist natively in JavaScript, it also doesn’t in VBScript. If you do need an equivalent function to that which is available in Read more…

By Chris West, ago