mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Add _.runInContext doc example.
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -539,6 +539,21 @@
|
||||
* @category Utilities
|
||||
* @param {Object} [context=root] The context object.
|
||||
* @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) {
|
||||
// Avoid issues with some ES3 environments that attempt to use values, named
|
||||
|
||||
Reference in New Issue
Block a user