Closed algotrex closed 3 years ago
The nextStudent
there is an argument, not a parameter. The difference is in what's passed in at the call-site vs what's received in the function signature. An argument is a value or source-reference variable, whereas a parameter is a target-reference. If we were showing the implementation (internally in the engine) of the log(..)
function, we'd potentially list out a parameter name for that first parameter, and that would be a target-reference.
Thanks for the feedback!
Please type "I already searched for this issue": I already searched for this issue
Edition: (1st or 2nd) 2nd
Book Title: Scope & Closures
Chapter: 1
Section Title: What's the Scope?
Question: In the section "Compiler Speak" where you enumerate all the source and target variables, you mention there are 5 target variables, I am wondering why we don't count the first argument of the
console.log()
function in the last line of the code:console.log(nextStudent);
As I understand the functionlog()
takes anobj1
parameter (see MDN documentation), so why don't we count this as a target variable for the same reason we count thestudentID
parameter as a target variable whengetStudentName
is invoked?