- Declaring a named function binds the function to the name in its surrounding environment. That’s why we can use the function rank within the function officer. Likewise, officer is declared in the global environment, and that’s why we can use it on the Node command line (or wherever we’re testing this code).
- We can declare a named function anywhere and its binding can be usedeverywhere. That’s why we can declare rank at the bottom of the function, but use it at the top.
No comment yet.
Sign up to comment
Your new post is loading...