我需要使下面的大if語句在JavaScript中更具可讀性。如何使這個大的if語句在JavaScript中更具可讀性
任何想法?
if (Tools.Array.contains(that.pAutocompleteAliasUsed[i], this.currentString) !== false &&
(this.autocomplete.list.length === 0) || (this.currentString.toLowerCase() !== this.autocomplete.list[0].target.alias.toLowerCase()))
{
make something
}
定義'更具可讀性'。當前版本有什麼問題? –
取決於你的可行性,有很多方法可以完成 –