Though out of topic, I just practice the examples in mdn from the scratch in vs code,in order to get a proper idea.
But when I executed the same in codepen, it got executed,Any help how to solve this?
Here is the code link
Could you explain a bit more how you are executing the code in VScode and what error (if any) you see?
Cheers,
Michael