Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. function solve(word, text) {
  2. text = text.toLowerCase().split(' ');
  3.  
  4. if (text.includes(word)) {
  5. console.log(word);
  6. return;
  7. }
  8.  
  9. console.log(`${word} not found!`);
  10. }
  11.  
  12. solve('python',
  13. 'JavaScript is the best programming language');
  14. solve('javascript',
  15. 'JavaScript is the best programming language');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement