Movies#2 (21 Hours 45 Minutes Trained!)

Austin Beaufort
2 min readJun 4, 2018

--

Today, as promised, I completed the movie object/array exercise from yesterday. The goal was to create a variable (movies) which stored an array of movie objects that included a title, rating, and “haveWatched” value for each. Title of movie is…the title. Rating is just a arbitrary rating I gave each movie or TV show (If I rated one of your favorites too low please forgive me!). Three Stooges are a classic and had to maintain that good ol’ 5/5 rating!!! The term “haveWatched” was given a value of true or false depending if I have watched the movie or not.

Second part of the exercise was to create a function which printed the data into the console for each movie in a logical sentence. Below are my results. #noproblem. My results turned out the correct results the instructor was looking for, however my results were coded differently from the instructor’s results. I included the instructor’s results in the results part of the codepen if you were interested in comparing the two. I did go into a seperate file and code it along with the instructor his way just for the learning experience.

To run the function be sure to right click inside the codepen and go to the console. Then type the function movieThing(movies);

More detailed instructions are listed on the codepen below:

After this exercise I continued on to learning about writing methods. As it turns out, methods are simply another name for a function placed inside of an object. I also gained a little more experience using the forEach function today. I remember learning about methods and objects in the first book I was working on(A Smarter Way to Learn JavaScript) before I began this Udemy course on web development. This time around I am getting a better understand of how methods work within objects and what the are used for. I did a small code along with the instructor for methods, but nothing of substance to post using a codepen.

If you enjoy following along on the 10,000 hour training challenge, be sure to clap, follow, etc. (mainly etc.) 21 hours down, 9,979 hours to go!!!

--

--

Austin Beaufort
Austin Beaufort

No responses yet