Head First HTML5 Programming
Building Web Apps with Javascript
(O'Reilly Media)
Eric Freeman (著), Elisabeth Robson (著)
開発環境
- OS X Yosemite - Apple (OS)
- Safari, Firefox, Google Chrome(Webプラウザ)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- HTML5 (マークアップ言語)
- JavaScript (プログラミング言語)
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 コメント:
コメントを投稿