| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Unexpected_type | [Back] [Original] |
Get to know MDN better
TypeError: Cannot read properties of undefined (reading 'x') (V8 ) TypeError: "x" is undefined (Firefox) TypeError: "undefined" is not an object (Firefox) TypeError: undefined is not an object (evaluating 'obj.x') (Safari) TypeError: "x" is not a symbol (V8 & Firefox) TypeError: Symbol.keyFor requires that the first argument be a symbol (Safari)
TypeError
Object.create() Symbol.keyFor()
undefined null
const foo = undefined;
foo.substring(1); // TypeError: foo is undefined
const foo2 = null;
foo2.substring(1); // TypeError: foo2 is null
const foo = {};
Symbol.keyFor(foo); // TypeError: foo is not a symbol
const foo2 = "bar";
Object.create(foo2); // TypeError: "foo2" is not an object or null
null undefined null undefined null
if (foo !== undefined && foo !== null) {
// foo
}
if (foo) {
// foo null/undefined
}
| Web Proxy Viewer | New URL | Original Page |