← Back to challenges

Find the Bomb

JavaScriptHardregexlanguage_fundamentalsstrings

Instructions

Create a function that finds the word "bomb" in the given string (not case sensitive). If found, return "Duck!!!", otherwise return "There is no bomb, relax.".

Examples

bomb("There is a bomb.") ➞ "Duck!!!"

bomb("Hey, did you think there is a bomb?") ➞ "Duck!!!"

bomb("This goes boom!!!") ➞ "There is no bomb, relax."

Notes

"bomb" may appear in different cases (i.e. uppercase, lowercase, mixed).

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Return the Factorial