3806 this.onKeyDown = (function() {
3807 var original = self.onKeyDown;
3808 return function(e) {
3809 var index, option;3810 if (e.keyCode === KEY_BACKSPACE && this.$control_input.val() === '' && !this.$activeItems.length) {
3811 index = this.caretPos - 1;
3812 if (index >= 0 && index < this.items.length) {
3806 this.onKeyDown = (function() {
3807 var original = self.onKeyDown;
3808 return function(e) {
3809 var index, option;3810 if (e.keyCode === KEY_BACKSPACE && this.$control_input.val() === '' && !this.$activeItems.length) {
3811 index = this.caretPos - 1;
3812 if (index >= 0 && index < this.items.length) {
3654 };
3655
3656 var equalizeSizes = function() {
3657 var i, n, height_max, width, width_last, width_parent, $optgroups;3658
3659 $optgroups = $('[data-group]', self.$dropdown_content);
3660 n = $optgroups.length;
3654 };
3655
3656 var equalizeSizes = function() {
3657 var i, n, height_max, width, width_last, width_parent, $optgroups;3658
3659 $optgroups = $('[data-group]', self.$dropdown_content);
3660 n = $optgroups.length;
3654 };
3655
3656 var equalizeSizes = function() {
3657 var i, n, height_max, width, width_last, width_parent, $optgroups;3658
3659 $optgroups = $('[data-group]', self.$dropdown_content);
3660 n = $optgroups.length;
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;
}
function foo() {
var bar;
let baz;
}
function foo() {
var bar = 1;
let baz = 2;
const qux = 3;
}