Impress Your Next Interviewer

Knowing certain JavaScript one liners can save you valuable time while developing or interviewing. Here are some of my favorite “once you know, you know” snippets that I have actually used while coding. Only one of them is a bit code golf-y, and unsurprisingly it uses reduce.

Wrap around a list

Spinning is a neat trick, but so is wrapping. A lot of times in algorithms you will need to wrap around a list. Meaning move a number of spaces, and if you reach the end of the list, go back to the first index. So if a list is 8 values long, but…


Spoiler Alert: Maybe.

JavaScript Sets and Maps have been around for a few years now, but I still get a lot of questions about them. My students wonder if they should be substituting traditional objects and arrays with these new data types. While there are some killer use cases for sets and maps, you should really look at them like specialized tools and not Swiss army knives.

When to use sets

A Set is a collection, like an array, except each value must be unique. They’re like what would happen if objects and arrays had a baby. Here’s a crash course (set docs):

const mySet = new


How to stop thinking like a Jr. Dev

When you’re a jr. dev it’s all about the tech. What frameworks do you know, how many languages can you use, how many animations can you put into your portfolio site, and so on. But, as you advance in your coding career, things start to change. It becomes less about the technology and more about your finishing projects. Your ability to work with your stakeholders and product team will become one of your most valuable skills. Below are some tips I’ve found to be helpful in my own, albeit limited, career.

Focus on the problem, not the solution

As odd as it may sound, once you start…


Easy code reviews are critical to successful projects

Asking people to code review your pull requests can be terrifying when you’re starting out. You don’t want to bother anyone, but your work has to be reviewed! Part of growing as a developer is asserting yourself more and putting your work out there, but there are steps you can take to make your code an easy review. And once you start being in charge of projects, having easy to review code can be the thing that saves you from missing deadlines.

Leave PR line comments yourself

If you take nothing else from this article, take this: Line comments are a phenomenal way to tell…


JavaScript examples, no fibonacci needed

If you’ve struggled to learn Recursion by using fibonacci or exponential JavaScript functions, then this article is for you. I had trouble with recursion at first because there are almost 2 aspects of “math” based recursion: the actual recursion, and the ever changing return values. Luckily, if we remove the return values from the equation, things get a lot simpler. We can accomplish this by focusing on iterating through an array.

What is recursion?

For a function to be recursive, it only has to do 2 things: 1) Call itself and 2) Know when to stop calling itself . That’s it, that’s all…


With an Infographic and Cheatsheet

Docker can be confusing when you’re getting started. Even after you watch a few tutorials, its terminology can still be unclear. This article is intended for people who have installed Docker and played around a bit, but could use some clarification. We’re going to make all three core pieces of Docker and give some helpful other commands. It’s going to cover a lot, be sure to click the links.


A nice alternative to Redux

Context is probably my favorite React feature, especially when using hooks. It’s not bleeding edge tech anymore, so you should take a second to learn how it works. We’re just going to create a Context component, and then read/set values from it in our main app. It’s going to be a very simple project, but one that shows the basics and how you can build on it in the future. Here is the code on GitHub.

What is Context?

Context lets you have global properties and functions that can be accessed from anywhere in your project. This is pretty much what Redux does…


How to talk to yourself like the sane person you are

When I first heard about “rubber duck debugging” where programmers talk to rubber ducks, I was sure it was hazing. I knew that when a senior dev said I should talk to the bath toy sitting on their desk, they would burst out laughing at me. But no, somehow it’s a real thing. A real, weird thing.

What is it?

What you are supposed to do is get a duck, or any inanimate thing with a face, and you explain your problem to it. Seriously. You, a full grown adult, take out a toy in your place of business and start talking to…


Learn how to promisify JavaScript timers

If you’ve ever wanted to then or await JavaScript’s setTimeout or setInterval, functions, you’re not alone. I’ve had to use these methods a lot at work to deal with some…interesting…third party behavior, so I’ve finally become familiar with promisifying functions. setTimeout may be simple, and setInterval is a tad trickier, so make sure you understand promises.

TL:DR; the code

const sleep = async (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
const asyncInterval = async (callback, ms, triesLeft = 5) => {
return new Promise((resolve, reject) => {
const interval = setInterval(async () => {…


Format and filter JSON in your terminal

The jq command line tool is definitely one of my favorite finds. If you’ve ever “prettified” JSON by copying it into VScode, I’m about to save you like 6 seconds by showing how to format (and even filter!) right in the terminal.

Download page, but on mac it’s easiest to brew install jq

Pretty print json

First, look at the difference of this command line output:

Mike Cronin

I’m Mostly Focused on JS and web development, but anything coding related is fair game

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store