https://odai1990.github.io/reading-notes/

Function is chunk of code that contain one statement or more to do specific task, also Function organize the code and prevents you from repeating yourself for ex: if you have task that you want to do it more than one time then you can add it to a function and call it when ever you wantany function you want to add you must follow this structure:
1. add function key word.
2. add name(best practice to be name refer to what function will do).
3. then open curly bracket and statements and close curly bracket.
call function just type functionName()


From Pictures below you will understand the mechanism

var x=functionName()