Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(searched, text) {
- let found = false;
- for (const word of text.split(' ')) {
- if (word.toLowerCase() === searched) {
- found = true;
- break;
- }
- }
- (found) ? console.log(`${searched}`) : console.log(`${searched} not found!`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement