The filter can be bypassed by putting the negative word amongst other characters:
console.log(swearjar.censor('<f-bomb>')); //**** - handled correctlyconsole.log(swearjar.censor('sdas<f-bomb>jkjf')); //sdas<f-bomb>jkjf - the word is muddled, but it got throughconsole.log(swearjar.censor('h<f-bomb>')); //h<f-bomb> - the word got through, and is fairly obviously there
The filter can be bypassed by putting the negative word amongst other characters:
console.log(swearjar.censor('<f-bomb>')); //**** - handled correctly
console.log(swearjar.censor('sdas<f-bomb>jkjf')); //sdas<f-bomb>jkjf - the word is muddled, but it got through
console.log(swearjar.censor('h<f-bomb>')); //h<f-bomb> - the word got through, and is fairly obviously there