I am in my very early stage of JS learning and just beginning to get used to and familiarize myself with the fundamentals of the the JS language. Last week, I spend lot of time understanding the basic JS function (declaration, expression, arrow functions) and write my learning-note about it. I have had already my share of many many frustrating moments to understand other JS topics clearly. After spending almost a week, I am still confused. The topic is not straight forward but confusing.
While learning functions, I came across yet another function – callback function. I spend some time learning about it and realized that it could be confusing to newbie like me. Nevertheless, I wrote a learning-note about callback function too.
Function Declaration vs Function Expression
Before I move on to other topics (eg. Objects), I opted to devote some time to understand the difference between function declaration & function expression. After learning basic difference in syntax, I started getting confused with conditionally created functions. To better understand this concept, basic knowledge of variable hoisting with
const and var/function scope is essential.
Scope & Hoisting
While learning functions (declaration & expression) and variables but I get confused when I start trying to untangle scope (variable & function), hoisting. My plan for next week or so is to understand variables (
const) and Function Scopes &
Waiting for My “Ah ha” Moment in JS Functions
Finally, I did some goggling to learn how other JS developers with similar to mine non-programmer background overcome their most frustrating learning experience. In a 2012 CSS-Tricks forum post Chris Coyier sought inputs from his site’s participant to share their The JavaScipt “Ah ha!” Moment. Most forum participant commented that understanding of closure, scope, hoisting, objects made them feel their “Ah ha” moment. From their comments, I recognized that JS Closure & Scope were the most frequently mentioned confusing topics to understand.
The following resources appear to be relevant to further review these topics: