mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Add _.runInContext doc example.
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -539,6 +539,21 @@
|
|||||||
* @category Utilities
|
* @category Utilities
|
||||||
* @param {Object} [context=root] The context object.
|
* @param {Object} [context=root] The context object.
|
||||||
* @returns {Function} Returns a new `lodash` function.
|
* @returns {Function} Returns a new `lodash` function.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* var lodash = _.runInContext();
|
||||||
|
*
|
||||||
|
* lodash.mixin({
|
||||||
|
* 'exists': function(value) {
|
||||||
|
* return value != null;
|
||||||
|
* }
|
||||||
|
* }, false);
|
||||||
|
*
|
||||||
|
* _.isFunction(lodash.exists);
|
||||||
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isFunction(_.exists);
|
||||||
|
* // => false
|
||||||
*/
|
*/
|
||||||
function runInContext(context) {
|
function runInContext(context) {
|
||||||
// Avoid issues with some ES3 environments that attempt to use values, named
|
// Avoid issues with some ES3 environments that attempt to use values, named
|
||||||
|
|||||||
Reference in New Issue
Block a user