Avoid-Using-Var
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery rule id: avoid-using-var
Section titled “Sourcery rule id: avoid-using-var”Description
Section titled “Description”Use const or let instead of var.
var a = 1Explanation
Section titled “Explanation”const is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code).
let may be used if you need to reassign references - it’s preferred to var because it is block- rather than
function-scoped.
From the Airbnb JavaScript Style Guide