Both will detect objects, not primitives.
This seems to be a purely syntactical difference.
// jslint prefers {}.constructor(obj) over Object(obj) // called isObject by underscore // will test only for objects that have writable keys // for example string literals will not be detected // but arrays will var isWritable = function (obj) { return {}.constructor(obj) === obj; };
javascript jslint
user3293653
source share