Dan Martensen

Software Engineering

Page 2


Type Checking Techniques in JavaScript Part 2 of 2

To get the most out of this article you’ll want a solid grasp of JavaScript’s data types including built-in, custom, and host objects. If you need a little refresher see Part 1.



As front-end developers today are working with larger code bases, more 3rd party frameworks, and in teams, using effective type checking techniques is critical to writing bug free code. And you know how it goes, right? Less bugs means less Jira tickets reopened, less QA regressions, less work for project leads, and happier managers.

But the JavaScript language seems to be working against us. With it’s untyped var keyword, absence of typed parameters in function signatures, and implicit type conversions, combined with the lack of a unified getType() function, our need for reliable approaches is only increased.

In this article I’ll cover three effective techniques for type checking and identify each of

Continue reading →


Type Checking Techniques in JavaScript: Part 1 of 2

One of the early milestones in grocking any programming language is knowing how to use its data types. Should be easy for a small scripting language like JavaScript, right? And yet because of the elusive var keyword, implicit type conversion system, and dubious type checking tools, working with types can be a confusing task for even experienced developers.

Before we cover type checking in detail we must thoroughly review data types in JavaScript, the purpose of Part 1. In this short post I’ll quickly cover the conceptual differences between primitive and object types, identify the types, and compare the built-in, custom, and host objects. Because this topic has been so muddied over the years I’m going to profusely site sources.


 Primitives vs Objects

Like many languages, JavaScript has both primitive and object types. Let’s explore the fundamental differences between these two:

Continue reading →


About Blog

This blog’s about my adventures as a full stack software engineer. I hope you find something useful here.

After earning a Computer Science degree a few years back, I’m enjoying a career as a software engineer in Boise, ID since May 2014.

If you have any questions or comments about my posts, feel free to reach out on LinkedIn.

Avator: Foot bridge on Mount Rainier, Washington USA

Continue reading →