From ffe8a729b7345e5812754152b9ce79cc3fde10a5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 13 Apr 2014 19:03:56 -0700 Subject: [PATCH] Add doc note to `_.isPlainObject` for objects created by `Object.create(null)`. [closes #526] [ci skip] --- lodash.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index cabe146a8..c3cf2645a 100644 --- a/lodash.js +++ b/lodash.js @@ -6453,7 +6453,8 @@ } /** - * Checks if `value` is an object created by the `Object` constructor. + * Checks if `value` is an object created by the `Object` constructor or has + * a `[[Prototype]]` of `null`. * * @static * @memberOf _ @@ -6475,6 +6476,9 @@ * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true */ var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {