I’m a complete novice to programming and am working my way through the book Learning to Program, by Steven Foote. Can anyone please help me with why Chrome is telling me I’ve got these two errors:
Uncaught TypeError: Cannot read property ‘currentDate’ of undefined
Uncaught TypeError: Cannot read property ‘projectName’ of undefined
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.
If you read the error’s you can see they have to do with the next 2 lines":
currentDate: new Date(),
is it wise to have the , so close to the () ?
projectName: ‘kittenbook’,
something here is wrong as well.
Thanks for the reply. Yes, I can see those two lines are the problem, but I can’t ascertain what the problem is. I’ll try to move the , and see if that helps for that line. I’m open to any other suggestions.
at this point you don’t even need the currentDate property inside the object. It depends on what you need to do with this, but it seems repetitive and you already have the data