Blog

JavaScript Snippet – String.prototype.after()

WARNING: Extending native prototypes is frowned upon by many JS engineers but can be helpful as long as the extensions are properly documented in the codebase. SCRIPTER’S DISCRETION IS ADVISED. 😆 Yesterday I added a post about String.prototype.before(...). As is explained within the post, this function can be used to Read more…

By Chris West, ago
Blog

JavaScript Snippet – Undo Camel Case

Probably due to it being so late, I was looking for code to uncamelize (undo camel-casing) any string. I came across what claimed to be a solution in PHP but unfortunately did nothing but lowercased my string. Therefore I decided to write my own solution: function uncamelize(s) { return s.replace(/[A-Z]/g, Read more…

By Chris West, ago
Blog

JavaScript – Modify URL Parameters

Recently I had to develop a solution which involved changing the HREF attributes of links in the navigation bar of a site. This had to be done on the JavaScript side because at my company we are the 3rd-party JavaScript solution for modifying other companies’ sites. That being said, I Read more…

By Chris West, ago