Closed TrojanerHD closed 1 year ago
When I started writing this bot, I didn't know that Array.prototype.some() exists and used a workaround:
Array.prototype.some()
const found: T | undefined = array.find((elem: T): boolean => elem === something); if (!found) console.log(false); else console.log(true);
this can be changed to
const found: boolean = array.some((elem: T): boolean => elem === something); console.log(found);
(In this case even to console.log(array.some((elem: T): boolean => elem === something));)
console.log(array.some((elem: T): boolean => elem === something));
When I started writing this bot, I didn't know that
Array.prototype.some()
exists and used a workaround:this can be changed to
(In this case even to
console.log(array.some((elem: T): boolean => elem === something));
)