Variable 'na' should be initialized on declaration
562 let fk
563 let pk
564 let nd
565 let na566 const cThis = this
567
568 if (sf == '') {
Variable 'nd' should be initialized on declaration
561 let table
562 let fk
563 let pk
564 let nd565 let na
566 const cThis = this
567
Variable 'pk' should be initialized on declaration
560 let oi
561 let table
562 let fk
563 let pk564 let nd
565 let na
566 const cThis = this
Variable 'fk' should be initialized on declaration
559 let sel
560 let oi
561 let table
562 let fk563 let pk
564 let nd
565 let na
Variable 'table' should be initialized on declaration
558 const deleteAll = action == 'delete'
559 let sel
560 let oi
561 let table562 let fk
563 let pk
564 let nd
Variable 'oi' should be initialized on declaration
557 let id = sf
558 const deleteAll = action == 'delete'
559 let sel
560 let oi561 let table
562 let fk
563 let pk
Variable 'sel' should be initialized on declaration
556 subform (sf, action = 'save') {
557 let id = sf
558 const deleteAll = action == 'delete'
559 let sel560 let oi
561 let table
562 let fk
Variable 'tab' should be initialized on declaration
92 const D = this.StartPositions
93 let top = 10
94 let scr = 0
95 let tab 96
97 if ($('#nuResponseTabs').length == 1) {
98 tab = String($('#nuResponseTabs').val()).substr(5)
Description
In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement. For example, in the following code, foo
is initialized during declaration, while bar
is initialized later.
var foo = 1;
var bar;
if (foo) {
bar = 1;
} else {
bar = 2;
}
Bad Practice
function foo() {
var bar;
let baz;
}
Recommended
function foo() {
var bar = 1;
let baz = 2;
const qux = 3;
}