Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(word, text) {
- text = text.toLowerCase().split(' ');
- if (text.includes(word)) {
- console.log(word);
- return;
- }
- console.log(`${word} not found!`);
- }
- solve('python',
- 'JavaScript is the best programming language');
- solve('javascript',
- 'JavaScript is the best programming language');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement