A function in Javascript is a set of goals to be completed or calculate numbers quicker. One of the examples from class I liked was “functions allow our code to be more maintainable an reusable!” All functions in javascript need an input, relationship, and output such as name, “passed zero or more pieces of information,” and “return a value” I believe calling a function in javascript is just one big piece of code bundled together. According to a site called launch code education, “Functions are data and therefore can be passed around just like other values. This means a function can be passed to another function as an argument. This allows the function being called to use the function argument to carry out its action.” My thoughts on this are if you create a function, you can reuse the function on a different project to save time because scripting takes a lot of time and patience. The “return” keyword allows you to send back data to the function you created in the first place pretty much ends the execution and goes back to the function.
Hi Montajim,
You provided lots of excellent information on functions! I agree that functions are essential when it comes to coding, so being able to understand and apply that knowledge is extremely important. Functions allow for the code to be easy to use and easy to maintain. Another huge part of a function is that it strays away from repeating code. Functions can perform many things, but we have seen a lot of mathematical examples throughout our class. Overall, I think you broke down just how important a function is in a way that is easy to understand!