3

On Monday this question got asked. I misread it and flagged it as a duplicate of this question, but retracted my vote after re-reading it as that's not a good dupe target for this specific issue. I then went on my way as an answer had been posted.

Today this question has been asked, so I'm thinking this is probably something that gets asked pretty frequently. Is anyone aware of a high quality canonical Q&A that deals with this specific problem for the next time it crops up?

3

1 Answer 1

1

I've taken the liberty of marking the first question in there as duplicate of Javascript function scoping and hoisting.

When one understands hoising, what's happening in the question you linked becomes obvious. It's the best I could find, so far.

1
  • Thanks - will add that to my list of targets. Not entirely sure it's a perfect fit for this issue, but it's certainly better than my initial choice! I agree that if you think about what's being discussed in that one it should help you understand the original questions too - guess I was hoping we might already have one that spells out what's going on here since it seems to be a frequent one in itself. Mar 2, 2016 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .