Skip to content

Case Sensitivity Error

Quick summary

You used Name instead of name (or vice versa) — most languages treat these as different identifiers.

Why this happens

  • Used uppercase where lowercase was expected (or vice versa)

  • Misspelled a property name with wrong casing

  • Called a function with the wrong case in its name

Minimal example

✗ Broken code
const user = { name: "Ada" };
console.log(user.Name); // undefined — wrong case!
✓ Fixed code
const user = { name: "Ada" };
console.log(user.name); // "Ada" — correct case

JavaScript is case-sensitive: name and Name are different properties. The object has name (lowercase), so user.Name returns undefined. Using user.name gives the correct value.

How to diagnose

  • Compare the name used with the original definition character by character

  • Check for camelCase, PascalCase, or snake_case conventions

  • Use your editor's autocomplete to see the correct name

How to fix

  • Match the exact casing of the original definition

  • Use autocomplete to avoid manual typing errors

How to prevent

  • Use an IDE with autocomplete and case-aware search

  • Follow consistent naming conventions in your project

Related Resources

Related Glossary

Related Lessons

  • Variables

    Learn about naming and case sensitivity.

← Back to language