Skip to content

Instantly share code, notes, and snippets.

@YerlinMatu
Created September 2, 2018 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YerlinMatu/0fbde9cfdb4ab9448ead2d1372c64e50 to your computer and use it in GitHub Desktop.
Save YerlinMatu/0fbde9cfdb4ab9448ead2d1372c64e50 to your computer and use it in GitHub Desktop.
Normalize - functional
const normalize = (text) => {
text = text.toLowerCase()
.replace(/#/g, '');
return text;
}
let arr = ['#FoO.', '#Test', '#hOlA'];
arr = arr.map(normalize);
console.log(arr);
@YerlinMatu
Copy link
Author

Delete hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment