Training Days deprecated parameters

Hey folks. So I’ve done the training days exercise in Javascript.
Some strange things are happening & I just want to know if I’m doing anything wrong…

Basically the code runs as it should. I watched the get unstuck video & I’m doing everything I’m supposed to.
But the ‘name’ & ‘event’ global parameters are crossed out in the text editor, saying they are deprecated. But the code doesn’t run properly if I delete or change.
& the AI generated tips in Codecademy are not recognising the changes that I’m implanting. Most notably it keeps telling me to put the ‘name’ variable globally & the random const in the getRandEvent function & I’ve done both of those things.

https://github.com/mattsteen14/training_days.git

I’m guessing they didn’t update the version of JS in the lesson yet(?). Perhaps it’s an older lesson (?)
Just keep name and event, but remember that going forward, they’re deprecated.

Okay. Thanks. Duly noted. Although it just doesn’t make sense how those few parameters are deprecated but the rest aren’t. The rest are also global const variables.

It was just a guess on my part.
Maybe @staledata would have more insights. :slight_smile:

I worked it out! I noticed that event2 & name2 weren’t crossed out so I made event & name event1 & name1 & it seems to have done the trick. The code still works & those parameters aren’t crossed out anymore.

1 Like

I know this is an old post but I went looking for this exact thread for the same exercise. It’s now been a year and the variables are still being marked as obsolete/deprecated. I am wondering if this is because the parameters passed (name, event) are the same as the global variables of name and event. Even though it wouldn’t cause an issue, them being labeled the exact same could cause some confusion in the coding and isn’t “in good practice”? I’m just a beginner but that was just my thoughts. Which would explain why renaming the parameters name1/event1 would get rid of the cross-through.