mirror of
https://github.com/google/blockly.git
synced 2026-01-06 00:20:37 +01:00
chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
This commit is contained in:
@@ -401,7 +401,7 @@ export function buildTooltipForDropdown(
|
||||
const blockTypesChecked: string[] = [];
|
||||
|
||||
return function (this: Block) {
|
||||
if (blockTypesChecked.indexOf(this.type) === -1) {
|
||||
if (!blockTypesChecked.includes(this.type)) {
|
||||
checkDropdownOptionsInTable(this, dropdownName, lookupTable);
|
||||
blockTypesChecked.push(this.type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user