Curtis Timson

Front End & .NET Developer

Month

October 2014

Preventing console.log issues in IE

In some older browsers, including versions of Internet Explorer, window.console doesn’t exist and therefore calling console.log() will result in an error. One way of fixing this is to create a function which checks whether console exists and use this function… Continue Reading →

Round to the nearest decimal

If we need round to the nearest whole number, we can use the Math.round() function to return this: Math.round(1.34234); //returns 1 However what if we need to round to a decimal place? For example 0.5. The following function can be… Continue Reading →

Mixing Revealing Module and Singleton Javascript Patterns

Until recently I’ve been using the Singleton pattern for my javascript objects. This works well as my functions are namespaced and therefore the risk of clashing object names across Javascript files is reduced. For this example I’ve created a singleton… Continue Reading →

© 2017 Curtis Timson — Powered by WordPress

Theme by Anders NorenUp ↑