9 } else {
10 $.get(url, function(data){
11 $("#state").val(data.state);
12 selectCity(data.city);13 $("#neighborhood").val(data.neighborhood);
14 $("#street").val(data.street);
15 $("#complement").val(data.complement);
12 d = moment.duration(amountHours);
13 h = Math.floor(d.asHours());
14 if (h < 10) h = "0" + h;
15 s = h + moment.utc(amountHours).format(":mm");16 $('#amount_hours').val(s);
17 });
18});
12 d = moment.duration(amountHours);
13 h = Math.floor(d.asHours());
14 if (h < 10) h = "0" + h;
15 s = h + moment.utc(amountHours).format(":mm");16 $('#amount_hours').val(s);
17 });
18});
12 d = moment.duration(amountHours);
13 h = Math.floor(d.asHours());
14 if (h < 10) h = "0" + h;
15 s = h + moment.utc(amountHours).format(":mm");16 $('#amount_hours').val(s);
17 });
18});
13 h = Math.floor(d.asHours());
14 if (h < 10) h = "0" + h;
15 s = h + moment.utc(amountHours).format(":mm");
16 $('#amount_hours').val(s);17 });
18});
Variables that aren't defined, but accessed may throw reference errors at runtime.
Potential ReferenceError
s may result from misspellings of variable and parameter names, or accidental implicit globals (for example, forgetting the var
keyword in a for
loop initializer).
Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/
comment, or specified in the globals key in the configuration file.
A common use case for these is if you intentionally use globals that are defined elsewhere (e.g. in a script sourced from HTML).
const foo = someFunction();
const bar = a + 1; // 'a' is undeclared
/*global someFunction, a*/
/*eslint no-undef: "error"*/
const foo = someFunction();
const bar = a + 1;