JavaScript, due to its ever-changing nature, has gathered a huge variety of conflicting conventions. Many of these conventions garner strong opinions either in support or in disapproval. We have, however, settled on some basic conventions around naming that are more or less globally accepted:
- Constants should be named with underscore-separated capitals; for example, DEFAULT_COMPONENT_COLOR
- Constructors or classes should be camel-cased with an initial uppercase letter; for example, MyComponent
- Everything else should be camel-cased with an initial lower case letter; for example, myComponentInstance
Apart from these foundational conventions, the decision of naming is left largely up to the creativity and skill of the programmer. The names you end up employing will be largely defined by what problems you're solving. Most code will inherit naming...