0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

XX is not a functionエラーがどうしても解決しないときの可能性

0
Last updated at Posted at 2019-03-27

JavaScriptで、XX is not a functionというエラーがどうしても解決しないことがあったので、参考になれば幸いです。

XX is not a functionエラーがどうしても解決しないときの可能性

セミコロンが絡んでいる可能性があります。
そのエラーは、次の様な状況で起きていました。
Screen Shot 2019-03-27 at 23.35.19.png
console.logが関数じゃないだって...!?
これは、一行目にセミコロンが無いからです。
Screen Shot 2019-03-27 at 23.35.43.png
これなら大丈夫です。
ちなみに、Numberリテラルにメソッド呼び出しを行うときは、32..toString()の様にドットを付ける方法もあります。
上の様なセミコロンのエラーが起きないし、簡潔なのでこちらを使う様にしましょう。Screen Shot 2019-03-27 at 23.39.10.png

終わりに

私は現在、Web3のサービスの開発をしています。詳しくはこちらの記事をご覧下さい。
無料でイーサリアムが当たる、Web3時代の寄付サイトを作った話

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?