Skip to content

Commit

Permalink
Add an early return for null/undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 28, 2015
1 parent 2e64fe6 commit f00381b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var isFunction = function (value) {

module.exports = function isEqual(value, other) {
if (value === other) { return true; }
if (value == null || other == null) { return value === other; }

var type = toStr.call(value);
if (type !== toStr.call(other)) { return false; }
Expand Down

0 comments on commit f00381b

Please sign in to comment.