59
61

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.

JavaScriptの命名規則早見表(と記法)

Last updated at Posted at 2021-10-25

JavaScriptを書く時に、命名規則について「あれどうだったっけ」となった時に参考になれば幸いです。
※ 業務であれば、チームなどによってルールが決まっていることもありますので、この限りではありません。

Javascriptの命名規則

記法 記法名
コンポーネント名 アッパーキャメルケース UserForm
変数名 ローワーキャメルケース sampleFunction
定数名 スネークケース API_URL
メソッド名 ローワーキャメルケース addNumber
プロパティ名 ローワーキャメルケース userName
クラス名 アッパーキャメルケース MyCar

おまけ: 記法について

記法 説明
アッパーキャメルケース 先頭と言葉の区切りは大文字、それ以外は小文字 UpperCamelCase
ローワーキャメルケース 先頭は小文字、言葉の区切りは大文字、それ以外は小文字 lowerCamelCase
スネークケース すべて大文字で、単語ごとにアンダースコアでつなぐ THIS_IS_SNAKE
59
61
0

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
59
61

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?