比较<和>正常情况一样,但任何涉及的=都应该使用+前缀。像这样:var x = new Date('2013-05-23');var y = new Date('2013-05-23');// less than, greater than is fine:x < y; => falsex > y; => falsex === y; => false, oops!// anything involving '=' should use the '+' prefix// it will then compare the dates' millisecond values+x <= +y; => true+x >= +y; => true+x === +y; => true希望这可以帮助!