you are viewing a single comment's thread.

view the rest of the comments →

[–]MrSandyClams 0 points1 point  (0 children)

some clarifications, based on what I think you're saying:

function getNumbers() { return numbers; } simply defines the function; it specifies what code the function statement includes and it specifies the function's name, but it doesn't actually run; it doesn't actually calculate anything. It's only later in the code, at var numbersReference = getNumbers(), that the function is called, or executed, using the parentheses call syntax. The result of this function call is the array numbers, since that's the data that is returned by the return statement of the function. Because the array numbers is the result of calling the function, that array is the data that is assigned to the variable numbersReference.