The Startup
Published in

The Startup

Building a Stack

Data Structures in JavaScript

Stack of Pancakes
Photo by nikldn on Unsplash

Node Class

Figure 1: Node Class

Stack Class

Figure 2: Stack Class

Push Function

Figure 3: Stack Class Push Function

Pop Function

Figure 4: Stack Class Pop Function

Peek Function

Figure 5: Stack Class Peek Function

isEmpty Function

Figure 6: Stack Class isEmpty Function

Additional Discussion

--

--

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
Mathew Phillip Wheatley

I am a software engineer with a mechanical background. Interests swing from aerospace, to woodworking, travel, skiing, hiking, running, climbing, and lasers.