Created
February 9, 2025 15:08
-
-
Save serid/cb634d6522bfb06f8a3bb269e98179c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { toString, map, filter } from './util.js' | |
async function main() { | |
let txt = await (await fetch('1.txt')).text() | |
let sanaset = txt.matchAll(/\w*/g) | |
sanaset = map(sanaset, x=>x[0]) | |
sanaset = filter(sanaset, x=>x!=='') | |
sanaset = map(sanaset, x=>x.toLowerCase()) | |
sanaset = Object.fromEntries(sanaset.map(k => [k,''])); | |
//document.getElementById('out').innerText = toString(sanaset) | |
let s = '' | |
for (let x in sanaset) { | |
s += x+'\n' | |
} | |
document.getElementById('out').innerText = s | |
} | |
await main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment