Skip to Content
Head First JavaScriptプログラミング、第2版
book

Head First JavaScriptプログラミング、第2版

by Eric Freeman, Elisabeth Robson
March 2025
Intermediate to advanced
662 pages
13h 28m
Japanese
O'Reilly Media, Inc.
Content preview from Head First JavaScriptプログラミング、第2版

第5章 オブジェクトを理解する オブジェクトを理解するオブジェクトヴィルへの旅

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

Image

これまで、あなたはコードにプリミティブと配列を使ってきた。また、単純なin文や条件付き文、関数によるfor/whileループを使うなど、極めて手続き的 方法でコーディングに取り組んできた。実際、オブジェクト指向ではないしかし、あなた自身のオブジェクトはまだ書いていない。さて、そろそろこの退屈な手続き的な町を離れて、自分でオブジェクトを作成する時期が来た。この章では、なぜオブジェクトを使うことがあなたの人生をより良いものにしてくれるのか、プログラミング的な意味で(ファッションセンスとJavaScriptのスキルのすべてを1冊で手助けすることはできないが)。注意:一度オブジェクトを発見したら、もう戻れない。その時はハガキを送ってね。

誰かが "オブジェクト "と言ったか?

大好きなトピックだ!オブジェクトは、複雑なコードの管理、ブラウザのドキュメントモデルの理解(次の章で説明する)、データの組織化......そして多くのJavaScriptライブラリがパッケージ化される基本的な方法でもある。オブジェクトは難しいトピックに違いないだろう?そうなんだ!この章では、オブジェクトの基本的な使い方について説明する。

JavaScriptオブジェクトの秘密はここにある:オブジェクトはプロパティのコレクションにすぎない。例えば、車だ。車には様々なプロパティがある:

Image

物件について考える

もちろん、実車にはこれ以外にも多くのプロパティが存在するが、コーディングの目的上、ソフトウェアで取得したいプロパティはこれらになる。これらのプロパティをJavaScriptのデータ型で考えてみよう:

Image
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

技術リーダーシップのための14のヒント

技術リーダーシップのための14のヒント

島田 浩二
カオスエンジニアリング ―回復力のあるシステムの実践

カオスエンジニアリング ―回復力のあるシステムの実践

Casey Rosenthal, Nora Jones, 堀 明子, 松浦 隼人
Tidy First? ―個人で実践する経験主義的ソフトウェア設計

Tidy First? ―個人で実践する経験主義的ソフトウェア設計

Kent Beck, 吉羽 龍太郎, 永瀬 美穂, 細澤 あゆみ

Publisher Resources

ISBN: 9798341633186