Это моя функция для включения кнопки, если выполняются условия и функция возвращает true.Я добавил дополнительный цикл for для поиска дубликатов, и теперь он работает неправильно.Посоветуйте, пожалуйста, где я допустил ошибку?
enabled(): boolean {
for (let i: number = 0; i < this.entries.length; ++i) {
let strText: string = this.entries[i].textN;
let strValue: number = this.entries[i].valueN;
if (strText.includes('=') || strText.includes(',')) {
return false;
}
if (strText == null || strText == undefined || strText == '') {
return false;
}
if (!strValue || strValue % 1 !== 0) {
return false;
}
for (let j = i + 1; j < this.entries.length; ++j) {
if (strValue[i] === strValue[j]) {
return false;
}
}
}
return true;
}