Javascript - Naming Conventions
Code Life
By Pierre Marsaa
What is camelCase?
In JavaScript, we follow a naming convention called camelCase for variables. But what does that mean?
- The first word starts with a lowercase letter
- Every following word starts with an uppercase letter
- No spaces or special characters between words
↗️
Loading editor...
↶
↷
Notice how each variable name looks like a camel's humps? 🐫 The uppercase letters create "humps" in the middle of the word!
Why does it matter?
Using camelCase makes your code easier to read and understand, especially when working with other developers. It's a standard convention in the JavaScript community, so following it makes your code look professional and consistent.
Verify