タイプエラー(メソッド名を間違えた場合)
let text = prompt('please input price');
console.lag( text );
Uncaught TypeError★: console.lag★ is not a function
at
★TypeError……補足不可能な型のエラー「console.lag」は関数ではない
リファレンスエラー(変数名を間違えた場合)
let text = prompt('please input price');
console.log( taxt );
Uncaught ReferenceError★: taxt★ is not defined
at
ReferenceError……補足不可の参照エラー:「taxt」は定義されていない
シンタックスエラー(同じ名前の変数を作ろうとした場合)
同じプログラムを実行した場合
Uncaught SyntaxError★: Identifier 'text'★ has already been declared
at
SyntaxError……補足可能なシンタックスエラー:識別子「text」は既に宣言(declared)されている
undefinedとは
「declared」=値がないの意。
値を入れていない変数や存在しないプロパティを参照したときにも表示される。
予防・修正対策
・Diffツール
http://mergely.com/editor
コードの比較参照に有用。
・テキストエディタ「Visual Studio Code」
コードの予測変換機能、色分けなど機能が充実して便利。
参考記事
https://fanblogs.jp/tabirpglab/archive/1238/0
【このカテゴリーの最新記事】
-
no image
-
no image
-
no image