My JavaScript Project

Nicholas Scalione
2 min readMay 14, 2021

My project is a playlist generator that people can use to create and share their favorite playlists and when they like to listen to them. The requirements heading into the project were to build an application with a HTML, CSS, and JavaScript frontend with a Rails API backend, meanwhile all interactions between client and server were required to be handled asynchronously (AJAX) and use JSON as the communication format. Also it was required to be Object Oriented JavaScript to encapsulate related data and behavior and lastly the Rails backend needed to have a resource with a has-many relationship and have at least 3 AJAX calls (at least two of Create, Read, Update, and Delete).

Incorporating OO JavaScript into our projects gave us a more in-depth look at OO programming and this time in a language we hardly had any familiarity with. Right away, using the constructor method you are immediately transferred back to the CLI project and initializing an instance of a class. The major difference here, is with JavaScript, we take an object and create a new one for the front end to use from the existing object, thus incorporating a new set of methods previously not available to the old object.

One other major difference was how and what we rendered. Previously we would render an erb file or redirect the user, however with a requirement stating that a user was not allowed to refresh the page, rendering in JSON became much more appealing. We still use the render method, but we specify that we are rendering in JSON format. By passing in additional arguments we can render right from the controller but aside from separations of concerns, this can get messy so you better use sterilizers if you go this route.

All in all, I have my work cut out for me in exploring the world of JavaScript. My app, with CRUD capabilities and a back end Rails API were a good intro into the world of JavaScript, but the possibilities to create with this language appear to be endless.

--

--