console.log
is a function. It writes some data to the console, but doesn't return a value for us to use, so it returns voiddoubleNumber
. The name is arbitrary, we could have named it whatever we want, but generally speaking it is a good idea to name the functions something sensible which clearly describes what the code inside will be doing. In this case it will be returning 2 times the value provided as an argument, so doubleNumber
is a simple, appropriate name.number
for simplicity. The most important thing when naming variables and functions is that their purpose and usage can be accurately guessed by someone else reading the code, just by looking at the name.console.log
to examine it, look at what happens.console.log
is showing us the definition of the function. It shows us what the variable contains, but it does not execute or "call" the function.doubleNumber
takes a single argument, so in order to call it and get a value back we can do something like this:()