Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hash(string) {
- string = string.split(' ');
- let words = string.filter(word => word.startsWith('#') && word.length > 1
- && /^[a-zA-Z]+$/.test(word.slice(1)));
- words = words.map(el => el.slice(1));
- console.log(words.join('\n'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement