2015年1月16日金曜日

開発環境

Head First HTML5 Programming: Building Web Apps with Javascript(Eric Freeman (著)、Elisabeth Robson (著)、O'Reilly Media)のChapter 2(Introducing JavaScript and the DOM: A Little Code)、EXERCISE(No. 1440)を解いてみる。

その他参考書籍

EXERCISE(No. 1440)

JavaScript (BBEdit, Emacs)

var scoops = 10;

while (scoops >= 0) {
    if (scoops === 3) {
        alert("Ice cream is running low!");
    } else if (scoops > 9) {
        alert("Eat faster, the ice cream is going to melt!");
    } else if (scoops === 2) {
        alert("Going once!");
    } else if (scoops === 1) {
        alert("Going twice!");
    } else if (scoops === 0) {
        alert("Gone!");
    } else {
        alert("Still lots of ice cream left, come and get it.");
    }
    scoops -= 1;
}

0 コメント:

コメントを投稿