2015年1月28日水曜日

開発環境

  • 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 4(JavaScript Functions and Objects: Serious JavaScript)、CODE MAGNETS(No. 2661)を解いてみる。

その他参考書籍

CODE MAGNETS(No. 2661)

JavaScript (BBEdit, Emacs)

var Movie = function (title, genre, rating, showtimes) {
    this.title = title;
    this.genre = genre;
    this.rating = rating;
    this.showtimes = showtimes;
    this.getNextShowing = function () {
        var now = new Date().getTime(),
            i,
            max,
            showtime;

        for (i = 0, max = this.showtimes.length; i < max; i += 1) {
            showtime = getTimeFromString(this.showtimes[i]);
            if ((showtime - now) > 0) {
                return 'Next showing of ' + this.title + ' is ' +
                    this.showtimes[i];
            }
        }
    };
};

0 コメント:

コメントを投稿