I am trying to create an array for listing purposes in Ionic Framework and check all the callcenter name's first char to add them in an alphabet array.
for (var i = 0; i < callcenterList.length; i++) {
var value = callcenterList[i]._owner && callcenterList[i]._owner.company.name[0];
if ((alphabet.indexOf(value) == -1 && isNaN(parseInt(value))) ||
(isNaN(alphabet[0]) && !isNaN(value))) {
if(!isNaN(value))
value = 123;
alphabet.push(value);
callcenterList.splice(i, 0, {
divider: {
alphabet: value
}
});
}
};
Replacing value = 123
with value = '#'
causes Google Chrome and Google Chrome Canary to malfunction and immediately use up to 100% of RAM in Mac.
Is this a Javascript bug or is it related to Google Chrome itself?