Closed mattfbacon closed 3 years ago
function isWelcomeMessage(message : string) { return (message.includes('welcome') || message.includes('Welcome')); }
can be replaced with
function isWelcomeMessage(message : string) { return message.toLowerCase().includes('welcome'); }
(And of course this can be an arrow function but that's up to you.)
This applies to Behavioral/chainOfResponsibility.ts
Behavioral/chainOfResponsibility.ts
but what if I don't want wElCoMe to be considered a welcome message >:)
/^[wW]elcome/.test(message)
can be replaced with
(And of course this can be an arrow function but that's up to you.)