TSLint Error “Expected a 'for-of' loop instead of a 'for' loop with this simple iteration”
问题 I have a for loop to get an ID from the DB: for(var i = 0; i < data.GetContractId.length; i++) { if (data.GetContractId[i].ContractId) { this.contractExists = true; } } Now I get the following TSLint-Error: Expected a 'for-of' loop instead of a 'for' loop with this simple iteration I'm not sure how to use it in this instance, can anyone help? 回答1: TSLint see that you could use for-of instead of for-loop it's just enhanced and more cleaner for (let contract of data.GetContractId) { if