JavaScript Intro

Posted by Kevin O'Brien on September 27, 2019

Over the past week and a half, we have begun the process of learning javascript, and how to implement a javascript frontend with a rails backend for several example applications. Some of these include a pokemon team project, which organized groups of up to six pokemon based on their trainer, and allowed customization and removal of pokemon, and a simple liker application, which registers the event of a mouse click on a heart icon and allows a user to like a post. So far the potential of JavaScript seems pretty incredible, and it definitely helps to not feel limited to reloading a page, or redirecting to a new page every time I wish to perform a new action on a web page. On my own, I found that JavaScript can be used to create a clone of the video game “Pong”. The article “Pong Clone in Javascript” by Matt Mongeau details the process of animating the paddles, and programming the computers AI to attempt to block the ball. What was incredibly interesting about the code provided was that there was a very small amount of literal HTML written. It was also very informative in providing a description of the requestAnimationFrame method, which calls the callback at a rate of 60 times per second. Though the actual code in the article was quite advanced, and not something I’d be able to figure out on my own, it was still functional and very entertaining!