This function is pretty easy. Like for example if wanted to add two numbers together I would write this:
In functions, we usually have to pass an argument(s) into the function. For example,
console.log() can is one of the many arguments to put into a function. Also when writing a function you also put in a pair of (), parentheses tell the computer that it's a function. Without the parentheses then the function couldn't work.
There is a more modern function we can write called an arrow function. This is how to write one.
In arrow functions, the first thing we write is const which in Java Script is what we put to make a variable after that we name it and put our variable names, then our arrow to make one you put an equal sign then put greater than sign. Then put in your "return" statement which in this case we are only want the code to do one thing other wise we do put a return statement, but we can get more into that in someother time for now just stick with the basic way.
Anyways I hope you learned something! Let me know if you want a part 2!!! Thank you!!