Python writes to local files using native function open. Javascript has no native function. Because...?
We can open a window, write arbitrary text to it, use the browswer to 'Save as...'. Close but no cigar.
I'd like to use JS for a lot more than the web. MS Basic wrote user-entered text to a file 40 years ago.