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版

第7章 タイプ 型、等式、変換、その他もろもろ:真面目な型

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

Image

型について真剣に考える時が来た。JavaScriptの素晴らしいところは、言語の詳細を知らなくても長い道のりを歩めることだ。しかし、この言語を本当にマスターし、昇進し、人生で本当にやりたいことに取りかかるには、型を使いこなす必要がある。第1章でJavaScriptについて述べたことを覚えているだろうか?JavaScriptには、銀の匙を投げるような、学術的な、専門家の査読を経た言語定義がない、と言ったのを覚えているだろうか?まあ、それは事実だが、アカデミックな生活がないからといってスティーブ・ジョブズやビル・ゲイツがJavaScriptを止めたわけではない。しかし、JavaScriptは最も考え抜かれた型システムを持っておらず、その過程でいくつかの特異性を発見するだろう。しかし、心配はいらない。この章では、そのすべてを明らかにし、すぐに型に関する恥ずかしい瞬間を避けることができるようになるだろう。

真実はそこにある

数値、文字列、ブールなどのプリミティブもあれば、JavaScriptが提供するオブジェクト(Math オブジェクトなど)、ブラウザが提供するオブジェクト(document オブジェクトなど)、自分で書いたオブジェクトなどだ。

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