A function in JavaScript is similar to a procedure a set of statements that performs a task or calculates a value, but for a procedure to be a function, it should take some input and return an output where there is some obvious relationship between the input and the output. To use a function, you must define it somewhere in the scope so it is specified. A function can be anonymous.
A JavaScript function is defined with the keyword function, followed by a name, and with parenthesis. Functions can contain numbers, letters, digits, dollar signs. An example would look like this Function name (parameter 1, parameter 2, parameter 3) { after the curly bracket is where the code would be executed. JavaScript is a great tool to use, it takes focus and hard work to learn. Once you learn how to input functions, it all becomes easier to use, functions are key when using JavaScript.
Hey Sami,
I think your analysis of functions in javascript is in place. In fact, functions are a very important part of javascript, which involves inference and participation in all decision-making in javascript.