クリスマスにのみ「雪」にしようとするのに少し問題があります。私はその日をつかむ方法を考え出しましたが、SnowStorm()を正しく呼び出す方法がわかりません。クリスマスに関数を呼び出す
あなたがisItChristmas
関数からブール値を返す必要が
var christmas = {
month: 11,
date: 25
}
function isItChristmas() {
var now = new Date();
var isChristmas = (now.getMonth() == christmas.month && now.getDate() == christmas.date);
if (isChristmas)
return ;
else
return ;
}
var snowStorm = null;
function SnowStorm() {
(snowstorm code)
}
snowStorm = new SnowStorm();
あなたは具体的にどっちつかんでいますか? 'isItChristmas'の部分ですか?あなたの 'snowStorm()'関数を空の 'if()'ステートメントに入れる方法は?他に何か? – Bojangles