Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Debugging Functions

Jelena Feliciano
seal-mask
.a{fill-rule:evenodd;}techdegree
Jelena Feliciano
Full Stack JavaScript Techdegree Student 12,729 Points

My call stack is returning anonymous not the li like in the video

The teachers video shows createLI and form.addEventListener in the callStack tab but for some reason mine is only appearing anonymous why is that? I haven't touched the code in anyway since we've begun the video

1 Answer

I wasn't sure on this either, but did some quick googling and found that if you simply rename the anonymous function, it will come back with that name. For example on line 59, change from:

form.addEventListener('submit', (e) => {

to:

form.addEventListener('submit', function FixAnon(e) {

Now, when you go through the same exercise, the Call Stack will begin with FixAnon, instead of Anonymous.

See the "Tips for debugging JavaScript in async call stacks" section here: https://www.html5rocks.com/en/tutorials/developertools/async-call-stack/