【发布时间】:2018-09-19 13:24:39
【问题描述】:
在正常循环中,我们可以循环数:
for(var i=1; i <= 4; i++){
console.log(i);//result : 1,2,3,4
}
在这种情况下,我想用日期进行循环,这样我就可以得到日期范围。
for(var i="11-04-2018"; i <= "14-04-2018"; i++){
console.log(i);
//hope can like this result : 11-04-2018,12-04-2018,13-04-2018,14-04-2018
}
但我知道那是代码,会出错:(
希望有人能理解我的意思:)
谢谢..
【问题讨论】:
-
@Ash 非常感谢,这对我有帮助 :)
标签: javascript jquery for-loop