A growing collection of interesting JavaScript and TypeScript snippets for fun and future profit.
Generate Excel-style column headers
This function generates column headers A...Z then starts two-letter combinations AA, AB...AZ, BA...BZ , and then three-letter combinations, etc, to an infinite degree.
Programmatically trigger a browser download
Sometimes a file or arbitrary generated data needs to be downloaded without the user having clicked a download link (e.g. an asynchronous process has just finished) and this seems to be the standard way to do it.