At various places, an element from array is being used at index. Instinct says replace it with a variable pointing to that element and use it. But is there any other difference than for better readability/management?
Example 1:
if (cols[i]["Type"] === 4) {
this.someFunc(cols[i]["Name"], cols[i]["Value"].VarA, cols[i]["Value"].VarB);
}
Example 2:
var col = cols[i];
if (col["Type"] === 4) {
this.someFunc(col["Name"], col["Value"].VarA, col["Value"].VarB);
}
col.Value.VarA. You win 3 caracters