JavaScript
91 articles · all categories
May 2017
Counting web sessions with JavaScript
How many touch points does your sales process require? Do you need 2 ad clicks or 5? Two shiny demos or one fat video? As an engineer, you might not care, but this is the stuff that keeps your CEO and growth lead and head of product up at night. A business owner that can answer that 👆 question reliably is god.
November 2016
How to waste hours of life with fetch() and a bit of brainfart
Both superagent and fetch() enable you to talk to a server. The first produces clean code that gets nesty if you need many things. The second produces clean code that is Promis-y and sometimes cumbersome. The difference between superagent and fetch() isn't that one sends your headers as-given and the other lowercases their names. The difference is that superagent sends a cookie and fetch() doesn't!
September 2016
A puzzle in JavaScript objects
This is a puzzle you can run into if you’re not careful, and sometimes, despite your best efforts, even if you are careful. It happened to me when I had a settings object that I passed into a view. The view then did things. When I made a new view from the settings object, it looked like the view I had just cleared.
July 2016
March 2016
December 2015
November 2015
A day is not 60*60*24 seconds long
Days aren't 60*60*24 seconds long. They are 1 day long, which on most days maps to 60*60*24 = 86400 seconds. But not on all days.
October 2015
August 2015
June 2015
March 2015
January 2015
Javascript debugging [slightly] beyond console.log
My favourite tool for javascript debugging is `console.log`. I mean, I love `console.log`. If I ever get a programming tattoo, it's going to be `console.log` or some variation thereof. Simple to use, works every time, and every programming language I've used since I was 9 has had some variation of it.
November 2014
June 2014
My new favourite Javascript trick
Using returns and callbacks in the same function. Sounds like crazy talk I know, but hear me out, I have good reason. I think.