Advertisement
kstoyanov

02. Modern Times of #(HashTag)

Jul 17th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(str) {
  2.   const arrStr = str.split(' ');
  3.  
  4.  
  5.   const isFind = arrStr.filter((word) => word.startsWith('#') && word.match(/[a-z]/g));
  6.  
  7.  
  8.   isFind.forEach((word) => {
  9.     if (word !== '') {
  10.       console.log(word.replace('#', ''));
  11.     }
  12.   });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement