I’m a complete newbie and tried to test my code in my browser’s console (inserted reference pic).
It has worked for the past days, but today I received this error message after I tried to call my function and I don’t know why?
I hope someone can help me with this, since it’s my first time using a browser console and I have no clue what’s going on. (Cleared my cache and switched browsers but it didn’t help)
The way you have your script.js file constructed, the displayTodos() function is a member of the todoList object. In the console, of you’ll use todoList.displayTodos() your browser will be able to find it just fine.
It looks like you’ve got some familiarity with JavaScript’s object notation already, but MDN has a great primer on this that might be informative for you.
Ah, so that’s because you’re executing it in the context of the iFrame wrapper, instead of in the project’s app page itself. If you instead choose the next item in the JavaScript contexts list it should work as expected: