What is the difference between a Stack and a Queue? As a student studying Javascript that can be a little tricky to answer. Unlike other programming languages, Javascript does not have an explicit data structure for either a stack or a queue. So for a lot of self-taught programmers and Bootcamp grads they may not know how to use these more advanced data structures let how to build and implement them. The alternative is that they have been using them all along and never realized it. Get ready for a crash course is Stacks and Queues!

What is a Stack?

A stack is a linear data structure with a “last in first out” principle. What does that mean? Imagine we have a list of information. When we add something to the list it gets added to the end. When we remove something from the list, we remove it from the end. It is like a stack of paper we add pieces of paper to the stack, and we remove pieces of paper for the top of the stack (We don’t pull from the bottom, or the middle). The important thing to remember is that the same end of the data structure is used to insert and delete data. …


This blog post is part 2 in a series of blog posts detailing the creation of a turn-based game of “tag” built with react.js. I recommend reading part 1 of this series of blogs before continuing. That being said… welcome back!

“Let’s Play Tag” A turn-based game built in react.js

Brief Recap

Where we last left off we built the game board, set up our game state to keep track of player locations on the board, and built the functions that would control player movement. …


An interview Question

“What is a Closure?” I was recently asked this in an interview. …

About

Andrew Rivera

Living life on my own terms. The coding experiments, projects, and search for computer science clarity from a Musician turned Web Developer.

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