diff --git a/test/objects.js b/test/objects.js index 6d432033a..0105d608a 100644 --- a/test/objects.js +++ b/test/objects.js @@ -38,7 +38,7 @@ $(document).ready(function() { result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); result = _.extend({}, {a: void 0, b: null}); - equals(_.keys(result).join(''), 'b', 'extend does not copy undefined values'); + equals(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); }); test("objects: defaults", function() { diff --git a/underscore.js b/underscore.js index 096a4800d..bf42fe006 100644 --- a/underscore.js +++ b/underscore.js @@ -635,7 +635,7 @@ _.extend = function(obj) { each(slice.call(arguments, 1), function(source) { for (var prop in source) { - if (source[prop] !== void 0) obj[prop] = source[prop]; + obj[prop] = source[prop]; } }); return obj;