Matt Popovich
Blog
< Back to HomeHow To Implement a Queue in JavaScript -- and Beat Arrays at Their Own Game
April 7th, 2020
A note about browsers, before we begin Firefox and Safari handle shift / unshift in a much more performant way under the hood than Chromium, so the performance test at the end is best viewed in Chrome or Edge! Otherwise the browser optimizes the…
Understanding Closures in JavaScript
March 12th, 2020
What's a Closure? Uses for Closures How Might This Trip Us Up? # What's a Closure? When you declare a function inside another function, a closure is the new environment created by combining the inner function with references to all variables…
How (and Why) To Implement a Stack in JavaScript
March 11th, 2020
What's a Stack? Implementing a Basic Stack Preventing Stack Underflows & Overflows Why Would We Want to Use a Stack? # What's a Stack? In computer science, a stack is a data structure, specifically an abstract data type . It's a type of…
Build a Twitter Bot in Half an Hour with Node.js and Heroku
January 3rd, 2016
Photo credit: crises_crs via Flickr They grab breaking news at lightning speed. They flit around correcting strangers’ grammar. They spit out nuggets of nonsensical yet weirdly fascinating gibberish. These days, it seems like Twitter bots are…