Functions are another important aspect to know about when coding in Javascript. Functions allow the code to become organized, easy to maintain, and even easier to use. They are somewhat similar to the functions of Excel, so if you are familiar with those functions, you may have an easier time working with functions in Javascript. All functions must have a name, are passed zero or more pieces of information, and return a value in most cases. Functions also help us from repeating unnecessary code, which is a huge no-no in the coding world. When you call a function, you are asking the code to complete whatever it is the function is meant to do. A lot of times this includes completing some math. You will see functions in Javascript as the function keyword followed by the function name, which is in parentheses and brackets. Just like variables, functions are essential to coding. Without knowledge of functions, you will have a very difficult time programming your code.
Image link: https://www.futurelearn.com/info/courses/programming-102-think-like-a-computer-scientist/0/steps/53095
Leave a Reply
You must be logged in to post a comment.