With interactive demo

https://images.unsplash.com/photo-1506521781263-d8422e82f27a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDF8fHBhcmtpbmclMjBsb3R8ZW58MHx8fHwxNjM0Mjg5MDcw&ixlib=rb-1.2.1&q=80&w=2000

Have you heard about the Parking Lot?

Yes?

No?

Ok, let me explain briefly.

The Parking Lot is challenge where you are asked to write a class that manage an imaginary parking lot. In this tutorial we will do that in JavaScript. And to make it a bit more interesting, we will create a small React app that will visualize the workings of our class.

Let's begin 🎉

Challenge Requirements

You have to implement a class in JavaScript. That class should consist of variables and methods enough to simulate the work of a parking lot. Here are the details:

Solution

Let’s take a look first at the class logic itself.

It’s pretty straightforward and I am sure there won’t be any surprises for most of you. Especially if you already have some programming experience. Especially in OOP and class based languages.

class ParkingLot