JavaScript

JavaScript event loop

Asynchronous JavaScript: The Event Loop

Today I attended Will Sentance’s workshop “JavaScript Hard Parts” on Frontend Masters. It was a foundational overview of how asynchronous JavaScript is processed using the JavaScript Event Loop. This is not a perspective that I have studied before. Perhaps I {…}

Posted by: John Dugan

Asynchronous JavaScript: Promises

What is a Promise? A promise is a placeholder for the result of an asynchronous operation. That’s it. JavaScript Promises may seem like a very complicated concept, but they are not. A promise is just placeholder. Why do Promises Exist? {…}

Posted by: John Dugan

Google Analytics Custom Events Emitter

A while back I looked in to implementing Google Tag manager so that marketing folks at my company could manage custom events in Google Analytics. Beyond custom events, I’m not sure what Google Tag Manager does (it’s been a while {…}

Posted by: John Dugan
Graphic of a code symbol set against a green background

Fixed Headers With hash Links

I was working on a site today that had several links in which the href attribute references an id or hash value on another page. The site has a fixed header, so I needed to way to offset the element {…}

Posted by: John Dugan
Graphic of a code symbol set against a green background

Four Rules to Define this in JavaScript

Understanding how this works in JavaScript is fairly simple. Knowing what this points to however… that is much more difficult. Scope and context become important concepts to understand. Knowing exactly what this points to and why within each function/method in {…}

Posted by: John Dugan
Graphic of a code symbol set against a green background

Demystifying Debounce in JavaScript

There are several situations in JavaScript where you want a function that is bound to an event to fire only once after a specific amount of time has passed. Functions bound to the resize and scroll events are the typical {…}

Posted by: John Dugan