A Product Manager Learns to Code: Week 7

Well, I (barely) finished up functions this week and leapt into arrays.

Hooray!

What I learned this week: 

  • Global Scope and Function Scope are different. Be mindful of what variables you assign inside a function as opposed to globally.
    • Global identifiers are a bad idea. Global identifiers can lead to bad variable names, conflicting variable names, and messy code. Rule of thumb - avoid.
  • Hoisting: Function declarations are “hoisted” in Javascript which means you can pretty much declare function and variables names anywhere, because Javascript " hoists" function declarations and variable declarations to the top. HOWEVER, variable assignments are not hoisted.
    • HOISTING IS SUPER CONFUSING.
    • I don’t understand why this happens in JavaScript or what value it brings… hopefully that's yet to come?
code_week_7.jpg

Accomplishments:

  • I finished the functions chapter. It's been the hardest - BY FAR. I barely got through it. I still need to visit Codecadmy for more practice on inline function declarations, which I found especially difficult.
  • I don't need any other accomplishments this week. I finished functions. That's it.

Reflections:

  • Functions were HARD for me. Especially grasping the idea of inline functions (that’s when a function acts as one of the declarations of another function.) I can read someone else’s function and it makes tons of sense, but writing one from scratch - it’s hard. And I’m not sure I could actually write them in real life either (or know when to use them.)