JavaScript Simple Functions.
In short terms, a function is a piece of program wrapped in a value, executing a function is called invoking, calling or applying. Also you can give values to a function when you call the function, this values are called arguments. Lets see an example:
const sum = function(numberOne, numberTwo){
return numberOne + numberTwo;
}
console.log(sum(5,4))
//output -> 9
Let’s explain this, we are creating a binding and assigning a function as a value, this function is declared with the function keyword, also it’s receiving two arguments, numberOne and numberTwo. The wrapped program sum this both values and return the result using the especial keyword return.
If you want to know more about functions. check this out -> Eloquent JavaScript