DEV Community

Cover image for JavaScript Rollercoaster Ride
Desiree Lerma
Desiree Lerma

Posted on

JavaScript Rollercoaster Ride

As the JavaScript phase in my Software Engineering program with the Flatiron School comes to a close I find myself reflecting on how much I have learned in the past 3 weeks. This week I was tasked with creating an application with a Rails API and JavaScript frontend. I came into JavaScript wide-eyed and bushy tailed. However, that quickly changed into feeling incredibly intimidated. JavaScript is such a dynamic language that it's quite easy to become overwhelmed with all there is to learn. However, as I began to grasp concepts little by little I developed an appreciation for JavaScript and all of the flexible functionality it provides.

Alt Text

My project, Marvelous Trivia, makes use of Object Oriented Programming to create a trivia game of Marvel Comic questions. My application has 2 classes, Question and Game, as well as an Index page where general functions are be rendered.

Alt Text

I felt lost at the start of my project because I felt as if there were so many directions I could take to execute a trivia game. To lessen the load, I began by mapping out my flow to determine where I would place a function to get the most bang for my buck. This helped immensely with determining where to begin! During my map out process I declared a relationship between my classes by having my questions belong to a game and vice versa (game has many questions). This meant I could separate my questions into different difficulty levels that my user can chose from. Then I could render only those specific questions based on a selected difficulty. This would also allow an automatic association when a player adds their own question to the database. Within the form to create a question, a difficulty level(game_id) is chosen which translates to which game that question becomes associated with.

One of my best friend throughout the creation of this application was a combination of the renowned debugger and the illustrious console.log(). These beauties helped me to better understand the inner workings of JavaScript. I would HIGHLY recommend using one or even both!

Debugger will stop your code where ever it is placed. You can then go into your console and type code from within your function to see what it is actually doing and or returning.

Console.log() allows you to pass in code snippets as an argument. When your application gets to that code it will not stop the program, but instead print the value of the argument you passed it, to the browsers console.

Alt Text

I used a combination of these throughout my project build. I will say I probably utilized console.log() the most to fully understand what value my JavaScript code held. This would, in turn, help me understand how my code needed to be built out to work in the way that I needed it to.

JavaScript can be an intimidating language, but please do not let it deter you from learning it. Take it in baby steps and take the time to understand the small things. JavaScript provides so much functionality to an application that can make a world of a difference. Although it will take time to understand the language I think it is worth the ride. The beauty of Software Engineering is the never ending learning after all, so take your time and start or continue to learn JavaScript.

Top comments (0)