Reference Error in Browser Console, Javascript

Hello guys!

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)

Heyu @iam96, welcome to the Glitch forum!

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.

Hope this helps!

Hi @cori!
Thank you for your reply and the link!

Unfortunately todoList.displayTodos() didn’t work either, I continue to receive the same error message.


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:

Conversely you could run it in the console for the app itself at

1 Like

Thanks so much cori! It works now! :grin:

1 Like