Blog

JavaScript Snippet – getClass()

If you have been using JavaScript for a little bit you probably already know how to determine a variable’s class constructor, but just in case you are overthinking it here is a hint: variable.constructor. šŸ™‚ Of course, many times I like to make functions that will spit my results for Read more…

By Chris West, ago
Blog

JavaScript – Degree & Radian Conversion

Two very simple operations that you may have to deal with if writing a JavaScript that deals with trigonometry are Math.degrees() and Math.radians(). These function can be easily defined as follows: The name of these functions indicates the end result. Using the above definitions, you could run code such as Read more…

By Chris West, ago
Blog

JavaScript – Number.getOrdinalFor()

Now Available in YourJS When dealing with numbers, at times for presentation’s sake, we need to add ordinals to numbers. For example, instead of today is the “September 28”, you may want to say that it is the “28th of September”. I wrote the following code snippet to easily add Read more…

By Chris West, ago