#messy code
14 messages · Page 1 of 1 (latest)
!!js.undefined
Uncaught TypeError: Cannot read properties of undefined (reading 'name') (or a very similar message)
This means you have tried to access a property on a value that is undefined. A value could be undefined (or null) for many reasons.
// Using a variable without declaring it:
foo.name;
// Declaring a variable, but not setting a value:
let foo;
foo.name;
// Declaring a variable, but setting it to undefined explicitly...
// or returning undefined from a function or method:
let foo = undefined;
foo.name
You'll have to find the variable on which you try to access the property, and work backwards to find out why it's undefined (or null). Errors come with stack traces right underneath. It will say the exact line and position where the error occurred.
i mean if anyone could maybe fix it?
Post the code in https://sourceb.in
okay
my guess is the clear method needs a null check, but yeah a sourcebin or something would be nice.
Uncaught TypeError: Cannot read properties of undefined (reading 'name') (or a very similar message)
This means you have tried to access a property on a value that is undefined. A value could be undefined (or null) for many reasons.
// Using a variable without declaring it:
foo.name;
// Declaring a variable, but not setting a value:
let foo;
foo.name;
// Declaring a variable, but setting it to undefined explicitly...
// or returning undefined from a function or method:
let foo = undefined;
foo.name
You'll have to find the variable on which you try to access the property, and work backwards to find out why it's undefined (or null). Errors come with stack traces right underneath. It will say the exact line and position where the error occurred.
hey dude i dont see any responses
Post the code in sourcebin, save and send the new link 🙂