I used Calumah's function posted above, but I did run into an issue with his code as poisted.
The rows are joined with a semicolon
csv.push(row.join(';'));
but the link generated has "text/csv" as the content type
Maybe in Windows that isn't a problem, but in Excel for Mac that throws things off. I changed the array join to a comma and it worked perfect.