Hey ya’ll, I’m in a weird spot. I am in the process of entering a full time developer role at work. (Woo! I’m ecstatic about the change!)
I’ve been working with front end tech for a little over a year, for the most part, it’s come naturally. I’ve had some struggles, but my good buddy Google (used as a middle between myself and Stack Overflow posts) has delivered when I’ve asked.
However, this new role is working in Vue, TypeScript, Php and Vanilla Js. I’m constantly in over my head, and have arrived at a point where I desperately need some help gaining a better understanding.
I don’t quite understand the point of Function Arguments in JS, weird right?
I use them occasionally, I make them work, I use arguments in methods, But outside of an if statement of a for-loop, I just don’t get what the heck I’m doing with the argument.
For example, I’m using a weather api to pull in a json object, parsing that object and using the weather key’s value to display, along with a corresponding icon (which I’ve downloaded and placed in the same folder as app.js, and I have an if statement that assigns the proper icon depending on the weather value.
This is where my thinking falls apart! I tried to programmatically choose the icon with a function, and spent the next 30 minutes trying to decide what kind of function would be needed, what the argument would be, and what in the world the argument would even do?
If I’m testing value1 === value 2, does there need to be an argument?
I (think) what I’m asking, how would you explain arguments to someone? Does it get used when testing values? Some functions dont need them, And I honestly couldn’t tell you why.