Skip to Content
JavaScript 第7版
book

JavaScript 第7版

by David Flanagan, 村上 列
November 2021
Intermediate to advanced
784 pages
12h 13m
Japanese
O'Reilly Japan, Inc.
Content preview from JavaScript 第7版

3章型、値、変数

プログラムは処理を実行するときに値を操作します。例えば、「3.14」のような数値や「Hello World」のような文字列値などを操作します。そして、プログラミング言語で操作する値の種類のことを型と呼びます。型は、プログラミング言語にとって最も基礎となるものです。プログラムが値を後ほど使いたい場合に、プログラム中で値を保管(代入)しておくためのものが変数です。変数は値に対して名前を付けて、この名前でその値を参照できるようにします。変数も、プログラミング言語にとって基礎となるものです。この章では、JavaScriptにおける型と値と変数について学習します。まず、これから概要の説明と、いくつか言葉を定義することからはじめます。

3.1 概要と定義

JavaScriptの型には、大きく分けて2種類あります。基本型オブジェクト型です。JavaScriptの基本型には、数値、文字列、論理値があります。それぞれ、§3.2§3.3§3.4で解説します。

JavaScriptの特殊な値であるnullundefinedは、基本型の値です。ただし、両者とも、数値でも文字列でも論理値でもありません。それぞれ、特別な型だと考えてください。そして、それぞれその型に属する唯一の値と考えるのがよいでしょう。nullundefinedについては、§3.5で詳しく説明します。ES6では、下位互換性を損なわずに言語を拡張できるように、Symbolという特別な型が追加されました。Symbol型については、§3.6で簡単に紹介します。

数値、文字列、論理値でも、Symbolでも、nullでも、undefinedでもないJavaScriptの値がオブジェクトです。オブジェクトは、プロパティ

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

Gatsby JS: Build PWA Blog with GraphQL, React and WordPress

Gatsby JS: Build PWA Blog with GraphQL, React and WordPress

Rangel Stoilov
Seleniumデザインパターン & ベストプラクティス

Seleniumデザインパターン & ベストプラクティス

Dima Kovalenko, 玉川 紘子, 太田 健一郎, 笹井 崇司

Publisher Resources

ISBN: 9784873119700Other