var day1 = new Date("2017-9-17");
var day2 = new Date("2017-10-18");
console.log((day2 - day1) / (1000 * 60 * 60 * 24));
更多专业前端知识,请上 【猿2048】www.mk2048.com
var day1 = new Date("2017-9-17");
var day2 = new Date("2017-10-18");
console.log((day2 - day1) / (1000 * 60 * 60 * 24));