Var used before declaration¶
[var-used-before-declaration] A JavaScript variable was used before its declaration.
This warning category is spelled [var-used-before-declaration] by qmllint.
Variable is used here before its declaration¶
What happened?¶
You used a variable before you declared it.
Why is this bad?¶
This makes the code harder to read. Variables declared with let or const will error out at runtime.
Example¶
To fix this warning, move the declaration before the usage: