Skip to content

Issue regarding Vanilla JavaScript template. #6616

Discussion options

You must be logged in to vote

Hey @Schnarfengargle123 - This seems to be occurring when you call the whatsThis function, it's likely to do with CodeSandbox having JS in strict mode by default, which means that undeclared variables aren't automatically global.

You're also using var, which is an outdated keyword - let and const are more modern!

If you move the var a within the function, it begins working

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Schnarfengargle123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants