I have eclipse setup to run all code in my project through JSHint and I noticed a warning about this below code (Expected a conditional expression and instead saw an assignment) and was trying to figure out the meaning.
Code:
if (item = Ext.getCmp(ids[index])) {
items.push(item);
if (deep && item.getRefItems) {
items.push.apply(items, item.getRefItems(true));
}
}
For the first if statement, are you just trying to check if the item object exists after you try and retrieve it from Ext.getCmp... I.E. would it be equal to this?
Code:
item = Ext.getCmp(ids[index]);
if (item)
{
items.push(item);
if (deep && item.getRefItems)
{
items.push.apply(items, item.getRefItems(true));
}
}