Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String.prototype[Symbol.iterator] = function* () {
- if (this.length > 1) {
- for (const i in this) yield this[i]
- } else {
- for (let code = 65; code <= this.charCodeAt(0); code++) {
- const c = String.fromCharCode(code)
- yield c
- // Word characters only
- // if ((/\w/).test(c)) yield c
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement