How to use JS to download the file to the client device?

A a string with arbitrary text. Want to download the line by means of JS on the client computer with a specific name (such as "time321.txt"). Googled 10 minutes... So anything suitable and is not found.

I will be grateful if prompt where to look or share a solution.
July 12th 19 at 16:43
1 answer
July 12th 19 at 16:45
Solution
jsfiddle.net/uselesscode/qm5ag
Is 10 seconds the request "javascript create text file".

Find more questions by tags HTMLJavaScript