• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Webtechnologien für Entwickler
  2. JavaScript
  3. JavaScript-Referenz
  4. JavaScript Fehler Referenz
  5. TypeError: "x" has no properties
  • Change language
  • View in English

Table of contents

  • Fehlermeldung
  • Fehlertyp
  • Was ist falsch gelaufen?
  • Beispiele
  • Siehe auch

TypeError: "x" has no properties

Fehlermeldung

TypeError: null has no properties
TypeError: undefined has no properties

Fehlertyp

TypeError.

Was ist falsch gelaufen?

Weder null noch undefined besitzen Eigenschaften auf die man zugreifen könnte.

Beispiele

null.foo;
// TypeError: null has no properties

undefined.bar;
// TypeError: undefined has no properties

Siehe auch

  • null
  • undefined

Last modified: Apr 9, 2021, by MDN contributors

Change your language

Related Topics

  1. JavaScript
  2. Tutorials:
  3. Einleitend
    1. JavaScript Grundlagen
    2. JavaScript first steps
    3. JavaScript building blocks
    4. Introducing JavaScript objects
  4. JavaScript Guide
    1. Einführung
    2. Grammatik und Typen
    3. Kontrollfluss und Fehlerbehandlung
    4. Schleifen und Iterationen
    5. Funktionen
    6. Ausdrücke und Operatoren
    7. Zahlen und Zeitangaben
    8. Textformatierung
    9. Reguläre Ausdrücke
    10. Indexierte Collections
    11. Collections mit Schlüsseln
    12. Mit Objekten arbeiten
    13. Feinheiten des Objektmodells
    14. Using promises
    15. Iteratoren und Generatoren
    16. Metaprogrammierung
    17. JavaScript modules
  5. Fortgeschritten
    1. Client-side JavaScript frameworks
    2. Client-side web APIs
    3. Eine Wiedereinführung in JavaScript
    4. JavaScript Datenstrukturen
    5. Vergleiche auf Gleichheit
    6. Closures
  6. Erweitert
    1. Vererbung und Prototypenkette
    2. Strict Modus
    3. JavaScript Typed-Arrays
    4. Speicherverwaltung
    5. Laufzeitmodell und Event-Loop
  7. Referenzen:
  8. Standardobjekte
    1. AggregateError
    2. Array
    3. ArrayBuffer
    4. AsyncFunction
    5. Atomics
    6. BigInt
    7. BigInt64Array
    8. BigUint64Array
    9. Boolean
    10. DataView
    11. Date
    12. decodeURI()
    13. decodeURIComponent()
    14. encodeURI()
    15. encodeURIComponent()
    16. Error
    17. This deprecated API should no longer be used, but will probably still work. escape()
    18. eval()
    19. EvalError
    20. FinalizationRegistry
    21. Float32Array
    22. Float64Array
    23. Function
    24. Generator
    25. GeneratorFunction
    26. globalThis
    27. Infinity
    28. Int16Array
    29. Int32Array
    30. Int8Array
    31. InternalError
    32. Intl
    33. isFinite()
    34. isNaN()
    35. JSON
    36. Map
    37. Math
    38. NaN
    39. null
    40. Number
    41. Object
    42. parseFloat()
    43. parseInt()
    44. Promise
    45. Proxy
    46. RangeError
    47. ReferenceError
    48. Reflect
    49. RegExp
    50. Set
    51. SharedArrayBuffer
    52. String
    53. Symbol
    54. SyntaxError
    55. TypedArray
    56. TypeError
    57. Uint16Array
    58. Uint32Array
    59. Uint8Array
    60. Uint8ClampedArray
    61. undefined
    62. This deprecated API should no longer be used, but will probably still work. unescape()
    63. This API has not been standardized. Dies ist eine veraltete API und es wird nicht mehr garantiert, dass sie funktioniert. uneval()
    64. URIError
    65. WeakMap
    66. WeakRef
    67. WeakSet
    68. WebAssembly
  9. Ausdrücke & Operatoren
    1. Addition assignment (+=)
    2. Addition (+)
    3. Assignment (=)
    4. async function expression
    5. await
    6. Bitwise AND assignment (&=)
    7. Bitwise AND (&)
    8. Bitwise NOT (~)
    9. Bitwise OR assignment (|=)
    10. Bitwise OR (|)
    11. Bitwise XOR assignment (^=)
    12. Bitwise XOR (^)
    13. class expression
    14. Comma operator (,)
    15. Conditional (ternary) operator
    16. Decrement (--)
    17. delete operator
    18. Destructuring assignment
    19. Division assignment (/=)
    20. Division (/)
    21. Equality (==)
    22. Exponentiation assignment (**=)
    23. Exponentiation (**)
    24. function* expression
    25. Function expression
    26. Greater than or equal (>=)
    27. Greater than (>)
    28. Grouping operator ( )
    29. in operator
    30. Increment (++)
    31. Inequality (!=)
    32. instanceof
    33. Left shift assignment (<<=)
    34. Left shift (<<)
    35. Less than or equal (<=)
    36. Less than (<)
    37. Logical AND assignment (&&=)
    38. Logical AND (&&)
    39. Logical NOT (!)
    40. Logical nullish assignment (??=)
    41. Logical OR assignment (||=)
    42. Logical OR (||)
    43. Multiplication assignment (*=)
    44. Multiplication (*)
    45. new.target
    46. new operator
    47. Nullish coalescing operator (??)
    48. Object initializer
    49. Operator precedence
    50. Optional chaining (?.)
    51. This is an experimental API that should not be used in production code. Pipeline operator (|>)
    52. Property accessors
    53. Remainder assignment (%=)
    54. Remainder (%)
    55. Right shift assignment (>>=)
    56. Right shift (>>)
    57. Spread syntax (...)
    58. Strict equality (===)
    59. Strict inequality (!==)
    60. Subtraction assignment (-=)
    61. Subtraction (-)
    62. super
    63. this
    64. typeof
    65. Unary negation (-)
    66. Unary plus (+)
    67. Unsigned right shift assignment (>>>=)
    68. Unsigned right shift (>>>)
    69. void operator
    70. yield*
    71. yield
  10. Anweisungen & Deklarationen
    1. async function
    2. block
    3. break
    4. class
    5. const
    6. continue
    7. debugger
    8. do...while
    9. empty
    10. export
    11. for await...of
    12. for...in
    13. for...of
    14. for
    15. function*
    16. function declaration
    17. if...else
    18. import.meta
    19. import
    20. label
    21. let
    22. return
    23. switch
    24. throw
    25. try...catch
    26. var
    27. while
    28. This deprecated API should no longer be used, but will probably still work. with
  11. Funktionen
    1. The arguments object
    2. Arrow function expressions
    3. Default parameters
    4. getter
    5. Method definitions
    6. Rest parameters
    7. setter
  12. Klassen
    1. constructor
    2. extends
    3. Private class fields
    4. Public class fields
    5. static
  13. Fehler
    1. Warning: -file- is being assigned a //# sourceMappingURL, but already has one
    2. TypeError: invalid Array.prototype.sort argument
    3. Warning: 08/09 is not a legal ECMA-262 octal constant
    4. RangeError: radix must be an integer
    5. SyntaxError: invalid regular expression flag "x"
    6. SyntaxError: return not in function
    7. TypeError: X.prototype.y called on incompatible type
    8. ReferenceError: can't access lexical declaration`X' before initialization
    9. TypeError: can't access property "x" of "y"
    10. TypeError: can't assign to property "x" on "y": not an object
    11. TypeError: can't define property "x": "obj" is not extensible
    12. TypeError: property "x" is non-configurable and can't be deleted
    13. TypeError: can't redefine non-configurable property "x"
    14. TypeError: cyclic object value
    15. TypeError: can't access dead object
    16. SyntaxError: applying the 'delete' operator to an unqualified name is deprecated
    17. ReferenceError: deprecated caller or arguments usage
    18. Warning: expression closures are deprecated
    19. SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated
    20. SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead
    21. Warning: String.x is deprecated; use String.prototype.x instead
    22. Warning: Date.prototype.toLocaleFormat is deprecated
    23. SyntaxError: test for equality (==) mistyped as assignment (=)?
    24. Warning: JavaScript 1.6's for-each-in loops are deprecated
    25. TypeError: setting getter-only property "x"
    26. SyntaxError: Unexpected '#' used outside of class body
    27. SyntaxError: identifier starts immediately after numeric literal
    28. SyntaxError: illegal character
    29. TypeError: cannot use 'in' operator to search for 'x' in 'y'
    30. RangeError: invalid array length
    31. ReferenceError: invalid assignment left-hand side
    32. TypeError: invalid assignment to const "x"
    33. RangeError: invalid date
    34. SyntaxError: for-in loop head declarations may not have initializers
    35. SyntaxError: a declaration in the head of a for-of loop can't have an initializer
    36. TypeError: invalid 'instanceof' operand 'x'
    37. TypeError: 'x' is not iterable
    38. SyntaxError: JSON.parse: bad parsing
    39. SyntaxError: Malformed formal parameter
    40. URIError: malformed URI sequence
    41. SyntaxError: missing ] after element list
    42. SyntaxError: missing : after property id
    43. SyntaxError: missing } after function body
    44. SyntaxError: missing } after property list
    45. SyntaxError: missing formal parameter
    46. SyntaxError: missing = in const declaration
    47. SyntaxError: missing name after . operator
    48. SyntaxError: missing ) after argument list
    49. SyntaxError: missing ) after condition
    50. SyntaxError: missing ; before statement
    51. TypeError: More arguments needed
    52. RangeError: repeat count must be non-negative
    53. TypeError: "x" is not a non-null object
    54. TypeError: "x" has no properties
    55. SyntaxError: missing variable name
    56. TypeError: can't delete non-configurable array element
    57. RangeError: argument is not a valid code point
    58. TypeError: "x" is not a constructor
    59. TypeError: "x" is not a function
    60. ReferenceError: "x" is not defined
    61. RangeError: precision is out of range
    62. Error: Permission denied to access property "x"
    63. TypeError: "x" is read-only
    64. SyntaxError: redeclaration of formal parameter "x"
    65. TypeError: Reduce of empty array with no initial value
    66. SyntaxError: "x" is a reserved identifier
    67. RangeError: repeat count must be less than infinity
    68. Warning: unreachable code after return statement
    69. SyntaxError: "use strict" not allowed in function with non-simple parameters
    70. InternalError: too much recursion
    71. TypeError: invalid arguments
    72. ReferenceError: assignment to undeclared variable "x"
    73. ReferenceError: reference to undefined property "x"
    74. SyntaxError: Unexpected token
    75. TypeError: "x" is (not) "y"
    76. SyntaxError: function statement requires a name
    77. SyntaxError: unterminated string literal
    78. TypeError: variable "x" redeclares argument
  14. Weiteres
    1. Technologienübersicht
    2. Lexikalische Grammatik
    3. JavaScript Datenstrukturen
    4. Enumerability und Ownership von Eigenschaften
    5. Protokolle zur Iteration
    6. Strict Modus
    7. Zum Strict Modus wechseln
    8. Template Strings
    9. Veraltete Bestandteile
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies