🟨 JavaScript camelCase Guide
The definitive guide to camelCase naming in JavaScript. Perfect for variables, functions, and React props.
Why camelCase in JavaScript?
camelCase is the standard naming convention for JavaScript. It's used by Airbnb, Google, and Mozilla style guides.
// ✅ Good camelCase examples
const userProfile = { ... };
const firstName = "John";
function getUserData() { ... }
// ❌ Avoid these
const user_profile = { ... }; // snake_case
const FirstName = "John"; // PascalCase
const userProfile = { ... };
const firstName = "John";
function getUserData() { ... }
// ❌ Avoid these
const user_profile = { ... }; // snake_case
const FirstName = "John"; // PascalCase
| Type | camelCase | Example |
|---|---|---|
| Variables | userName | const userName = "john"; |
| Functions | getData() | function getData() {} |
| Object properties | firstName | { firstName: "John" } |
| React props | onClick | <Button onClick={...} /> |
Try It: Convert to camelCase
Enter text above...