JavaScript: Even More Difficult than I Thought it Would Be

Echoing the thoughts of some of my peers, I found this week’s Codecademy lessons to be the most difficult to really understand. In particular, the lessons on functions, arrays, and looping really confused me, and I needed to go over practically each hint to figure out the correct code.

I think what I am struggling with most in learning JavaScript is understanding the purpose behind some of the pieces of code we are learning. I am still not exactly sure what a function does, which is the main thing I am struggling to understand, but I also don’t quite understand the purpose of elements like .pop() and .push() – why not change the initial array to include or exclude the items you specify in .push() or .pop()? I think seeing more real-world examples, like we did last week, will help me now that I’ve gone over the basic foundation laid out by Codecademy.

Another thing I struggled with was understanding how to correctly write pieces of code inside of code. Codecademy would ask me to write a for loop inside of a for loop, and I would have no idea how to set that up or where in the code to begin. It also made it hard to differentiate where one element of the code ended and another began.

As we go along, I am interested to learn more about how JavaScript, HTML, and CSS can work together. In Codecademy, it was really cool to see how you could use all three to make elements clickable or make them disappear. I know we went over a real-world example in class, but I’m excited (and slightly scared) to delve into making the gallery for next week’s assignment. I think it will be the best way to help me understand what I’ve learned. I am also looking forward to learning more about JQuery, since anything that can make JavaScript easier to understand and execute will be a big help. 

1 thought on “JavaScript: Even More Difficult than I Thought it Would Be

  1. Greg Linch

    “I also don’t quite understand the purpose of elements like .pop() and .push() – why not change the initial array to include or exclude the items you specify in .push() or .pop()?”

    Good question. The purpose of these methods (because they’re functions that attach to arrays) is to dynamic add or remove items in an array. For example, if you had an initial list of participants for an event (an array) and wanted to be able to add (push) or remove (pop) them based on an add form or remove button.

    “Codecademy would ask me to write a for loop inside of a for loop, and I would have no idea how to set that up or where in the code to begin.”

    This is similar to HTML nesting — it works the same way and you just need to be sure it’s properly nested. For example:

    https://stackoverflow.com/a/35208006/217955

    Reply

Leave a Reply to Greg Linch Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.