[tslint]Expected a 'for-of' loop instead of a 'for' loop with this simple iteration (prefer-for-of)
问题 I have got a tslint error to my for loop when I try to resolve it it says to convert to for-of. I have seen many docs but its not helpful.How can I solve the lint error and I cannot do tslint:disable-next-line:prefer-for-of for (let i = 0; i < this.rows.length; ++i) { if (!this.rows[i].selected) { this.selectAllChecked = false; break; } } 回答1: It is asking you to use format like the following. The of keyword loops over the objects in the array instead of looping over the indexes of the array.