Fix a typo in 1.6.6 (function object, NFE)
This commit is contained in:
parent
ae723281e5
commit
e8455bc5bc
1 changed files with 1 additions and 1 deletions
|
@ -347,7 +347,7 @@ If the function is declared as a Function Expression (not in the main code flow)
|
|||
|
||||
Also, functions may carry additional properties. Many well-known JavaScript libraries make great use of this feature.
|
||||
|
||||
They create a "main" function and attach many other "helper" functions to it. For instance, the [jQuery](https://jquery.com) library creates a function named `$`. The [lodash](https://lodash.com) library creates a function `_`, and then adds `_.clone`, `_.keyBy` and other properties to it (see the [docs](https://lodash.com/docs) when you want learn more about them). Actually, they do it to lessen their pollution of the global space, so that a single library gives only one global variable. That reduces the possibility of naming conflicts.
|
||||
They create a "main" function and attach many other "helper" functions to it. For instance, the [jQuery](https://jquery.com) library creates a function named `$`. The [lodash](https://lodash.com) library creates a function `_`, and then adds `_.clone`, `_.keyBy` and other properties to it (see the [docs](https://lodash.com/docs) when you want to learn more about them). Actually, they do it to lessen their pollution of the global space, so that a single library gives only one global variable. That reduces the possibility of naming conflicts.
|
||||
|
||||
|
||||
So, a function can do a useful job by itself and also carry a bunch of other functionality in properties.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue