I was once challenged to save some data so that it would persist when the user refreshed the page, in this case, the data was an array of favorite objects that would need to persist. After doing some digging I quickly came across localStorage in the MDN Web Docs. After looking over its documentation I quickly came to the conclusion that localStorage was exactly what I needed. Here is a simplified rundown of how to get local storage to persist an array of objects.

First, we start with our initial array of objects. …


I was having some trouble sorting by the highest score from an array of player objects. After doing some digging I found a way that was much simpler than I had first anticipated. This is a rundown of how it’s done.

First will start with our array of player objects.

As you can see we have an array with five player objects, each player has a name and a score. The goal is to console.log the array with the players arranged by score, from highest to lowest.

In order to achieve this, we will use javascript’s built-in array.prototype method, .sort()…


In my last blog, I demonstrated the very basics of prototypal inheritance. We started by building a constructor that would be the blueprint for a Dog object, then we used the blueprint to build out a couple of dogs with corresponding attributes. Once we had our Dog constructor and our dogs we created with it, we added a method to the built-in prototype property called fatten() that would increase the weight of our dogs by one and then console.log the proof of it. We then just called our new method on our two dogs and saw them both fatten by…


It was a nightmare, I was in the middle of a technical interview and was being asked some questions about Javascript, the interviewer then asked me to talk a little about prototypal inheritance and I froze. I’m fairly new to programming and thought that I had a good understanding of Javascript fundamentals, but when put on the spot to really flex what I knew I realized that my shallow understanding of some aspects of Javascript just wouldn’t cut it professionally.

So here I am, using this blog to really cement prototypal inheritance into my brain and I hope by doing…


I am currently working through a coding Bootcamp and had a week to plan and execute a small app to show off some of the skills that we have acquired with Rails as our backend API and React as our frontend. I wanted to create something that utilized a shopping cart because it’s something that I had never attempted and thought this project would be a great place to learn. I knew the key to my success was planning out the foundation of my rails backend, I knew that if I made a mistake on the backend it would only…


Reduce is an extremely helpful swiss army knife of array methods. Reduce works like this, let’s say you have an array of numbers:

Now let’s say you want the sum of all the numbers in this array, reduce can work perfectly for this!


Throughout the course of our lives, we have all seen technology seep into every aspect of our daily routines. For me personally, watching the evolution of technology in the restaurant industry has been a point that has always piqued my interest. Before redirecting my career towards technology I worked in kitchens, when I first began working in restaurants, kitchens often repelled at the notion of introducing the newest technology. From a chef’s perspective technology had always been associated with corporate fast food. Tech in fast food takes the majority of the responsibility in making sure that a consistent food product…


A few years ago, I had taken an introductory course to front-end web development in college which I really enjoyed. At the time, it was difficult to keep up with coding due to my full-time job as a chef. As a result of the pandemic, I lost my job cooking professionally in restaurants and looked for a change. During lock-down, I attempted to learn Javascript online to keep myself busy and found that I really enjoyed the challenging, problem-solving aspects of coding. …

Greg Wright

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