JSFiddle - React, Tailwind, and code Playground

by Andrey Gershun

HTML

<script src="http://alasql.org/console/alasql.min.js"></script>

    <button onclick="window.exportData()">Export data to CSV file</button>

JavaScript

var data = [["Minsk",100000], ["Riga",200000]];

window.exportData = function exportData() {
        alasql("SELECT * INTO CSV('cities.csv') FROM ?",[data]);
    }