3 ms·
> A declaration can only declare that a variable exists. Yes; that's the only correct thing in your comment. A declaration can declare that a variable exists,
by kazinator 3y ago
> A declaration can only declare that a variable exists.
Yes; that's the only correct thing in your comment.
A declaration can declare that a variable exists, and nothing more, which is useful in some language that has a strict rule that variables must have been indicated as existing before they can be used.
If a declaration causes the variable to exist, then it's a definition.
However, about that specific example, "let foo;" in Javascript is actually a definition. It causes foo to exist in the scope where it appears, with a value of undefined.