Skip to Content
つくって楽しいJavaScript入門 身近な不思議をプログラミングしてみよう
book

つくって楽しいJavaScript入門 身近な不思議をプログラミングしてみよう

by スペースタイム 柳田 拓人, サイエンス&プログラミング教室 ラッコラ
November 2021
Intermediate to advanced
256 pages
6h 17m
Japanese
Shōeisha
Content preview from つくって楽しいJavaScript入門 身近な不思議をプログラミングしてみよう
010
エラーの種類と表示
 主なエラーは、「構文エラー」と「参照エラー」の 2 つです。
 構文エラーはプログラムの構文(文法)上の誤りがあるときに出ます。先ほどの例のように、括
弧の種類を間違えたりした場合です。
 日本語の文章でも、句読点が抜けていたり、括弧の対応が取れていなかったりすると、読んでい
て「あれっ? 意味がわからないぞ!」となりますよね? それと同じです。
 一方、参照エラーは、コンピューターが、入力された文字を何かの「名前」だと思ったのに、そ
んな名前の「もの」は見つからなかった、というときに出ます。ようするに、名前を打ち間違えた
ということです。
 エラーはコンソール出力に日本語で表示されます(図 1-8)。数字はエラーが発生したのが何行
目の[何桁目]なのかを表し、クリックするとその行にジャンプします。
 プログラミングしていると、エラーはたくさん出るものです。そんなときは、落ち着いて、エ
ラーがあると言われた行のあたりをよく確認しましょう。
1-8
Croqujs のエラー表示
Column
全角と半角
プログラムを入力するときは、漢字変換機能がOFFになっていることを確認しましょう。例えば、半角
スペースの代わりに全角スペースを入力するとエラーになります。
エラーが出てもガーン
と思わない! 間違い
を教えてくれたんだか
ら、ありがたいね!
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

初めてのSQL 第3版

初めてのSQL 第3版

Alan Beaulieu, 株式会社クイープ
エンジニアが学ぶ会計システムの「知識」と「技術」

エンジニアが学ぶ会計システムの「知識」と「技術」

広川 敬祐, 五島 伸二, 小田 恭彦, 大塚 晃, 川勝 健司

Publisher Resources

ISBN: 9784798169408