Other than functions are very popular, functions in JavaScript have an important place. Function groups up statements and can be reused to make coding less time-consuming. The function can take provided information, do various types of calculations with the information, and return the result. It is almost like an Excel formula, but unlike Excel, you can build the function as you like. In a way, function is just a math problem, like the ones we did in regular math class. Unlike a regular math problems, we introduce variables which stored numbers, we create a function to receive a sum of two variables and function adds numbers and returns a result for us. For easier use, later we can change just on number and use the same function to receive a new result. We can start writing the function code with the keyword function following with the actual name of the function.
Leave a Reply
You must be logged in to post a comment.