Inside the function block, or function body, you can declare variables. In the example script, a variable called cubedNumber was created inside the function body. A variable that is created within a function is called a local variable. The word 'local' means that the variables are only accessible inside the function. Therefore, you cannot refer to the variable cubedNumber anywhere but inside the function body. By contrast, a global variable is accessible throughout the entire program. This concept is known as variable scope. Any variable defined outside a code block is global, whereas variables created inside a code block have a local scope.
In the cube example, the parameter 'number' only exists within the scope of the function. If you try to access it anywhere outside the function, an error will be produced. Further, each time the function is called, a new variable - number - is created. It is important to note that variables do not retain values across function calls.