我有一個條件裏面我有一個循環,當我運行的代碼我能夠通過條件,但在我的條件我有一個循環,沒有得到執行。我的循環沒有得到執行
此線之上構造
currentDate = new Date();
這條線在我的控制檯類
if (form.value.packType == "Per Week") {
console.log("I could able to see this console");
for (var a = this.currentDate.getDate(); a < 8; a++) {
console.log("I could not see this console",a)
}
}
裏面,我可以看到的「每一週」的價值,但我一個無法看到控制檯在我的日誌裏面。
有人可以幫助我。
「每週」或「每週」? – Vega
我能夠通過條件,只有我無法看到循環內的值 –
通過在if語句之前執行console.log(form.value.packType)來檢查您是否有「每週」 – Vega