JSLint error: `_reset` was used before it was defined