• 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. 開発者向けのウェブ技術
  2. JavaScript
  3. JavaScript リファレンス
  4. JavaScript エラーリファレンス
  5. TypeError: "x" has no properties
  • Change language
  • View in English

Table of contents

  • メッセージ
  • エラータイプ
  • 何がうまくいかなかったのか?
  • 例
  • 関連項目

TypeError: "x" has no properties

メッセージ

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

エラータイプ

TypeError。

何がうまくいかなかったのか?

null と undefined に、アクセス可能なプロパティはありません。

例

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

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

関連項目

  • null
  • undefined

Found a problem with this page?

  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Apr 12, 2021, by MDN contributors

Change your language

Related Topics

  1. JavaScript
  2. チュートリアル:
  3. 初級編
    1. JavaScript の基礎
    2. JavaScript first steps
    3. JavaScript building blocks
    4. Introducing JavaScript objects
  4. JavaScript ガイド
    1. 入門編
    2. 文法とデータ型
    3. 制御フローとエラー処理
    4. ループとイテレーター
    5. 関数
    6. 式と演算子
    7. 数と日付
    8. テキスト処理
    9. 正規表現
    10. インデックス付きコレクション
    11. キー付きコレクション
    12. オブジェクトを利用する
    13. オブジェクトモデルの詳細
    14. Using promises
    15. イテレーターとジェネレーター
    16. メタプログラミング
    17. JavaScript modules
  5. 中級編
    1. Client-side JavaScript frameworks
    2. Client-side web APIs
    3. JavaScript 「再」入門
    4. JavaScript のデータ構造
    5. 等値比較と同一性
    6. クロージャ
  6. 上級編
    1. 継承とプロトタイプチェーン
    2. Strict モード
    3. JavaScript 型付き配列
    4. メモリ管理
    5. 並列モデルとイベントループ
  7. リファレンス:
  8. ビルトインオブジェクト
    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. これは非推奨の API です。まだ動作しているかもしれませんが、もう使用するべきではありません。 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. これは非推奨の API です。まだ動作しているかもしれませんが、もう使用するべきではありません。 unescape()
    63. この API は標準化されていません。 これは廃止された API であり、動作は保証されていません。 uneval()
    64. URIError
    65. WeakMap
    66. WeakRef
    67. WeakSet
    68. WebAssembly
  9. 式と演算子
    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. これは実験段階の API です。製品内のコードで使用しないようご注意ください。 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. 文と宣言
    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. これは非推奨の API です。まだ動作しているかもしれませんが、もう使用するべきではありません。 with
  11. 関数
    1. The arguments object
    2. Arrow function expressions
    3. Default parameters
    4. getter
    5. Method definitions
    6. Rest parameters
    7. setter
  12. クラス
    1. constructor
    2. extends
    3. Private class fields
    4. Public class fields
    5. static
  13. Errors
    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. その他
    1. JavaScript 技術概説
    2. 字句文法
    3. JavaScript のデータ構造
    4. プロパティの列挙可能性と所有権
    5. 反復処理プロトコル
    6. Strict モード
    7. strict モードへの移行
    8. テンプレート文字列
    9. 廃止予定の機能
  • 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