const countEm = (str) => { str = str.toLowerCase(); return 'abcdefghijklmnopqrstuvwxyz'.split('').map((letter) => { return str.indexOf(letter) === -1 ? '0' : '1'; }).join('') };
Thanks for the challenge!
There's also String.prototype.includes
String.prototype.includes
const letters = "abcdefghijklmnopqrstuvwxyz".split("") const countEm = str => { str = str.toLowerCase() return letters.map(letter => str.includes(letter) ? "0" : "1").join("") }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the challenge!
There's also
String.prototype.includes