From c0265f8fd9eb5e997bca3ef1c470601ef60e2768 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 20 May 2014 00:53:32 -0700 Subject: [PATCH] Add `_.runInContext` doc example. --- lodash.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lodash.js b/lodash.js index ff1f543b9..6f3719409 100644 --- a/lodash.js +++ b/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