I want the code to return a 2d array of the results. E.g. clothes = [[1,"name","desc"],[2,"name2","desc2"]] can you make res send a list or do you have to make a list once you have returned it?
app.get('/post', (req, res) => {
    con.connect(function(err) {
        if (err) throw err;
        var query = "SELECT * FROM products"
        con.query(query, function (err, results, fields) {
          if (err) throw err;
          var clothes = [];
          Object.keys(results).forEach(function(key) {
            let r = []
            var row = results[key];
            r.push(row.ID);
            r.push(row.name);
            r.push(row.link);
            r.push(row.imageLink);
            r.push(row.type);
            r.push(row.colour);
            r.push(row.price);
            r.push(row.brand);
            clothes.push(r);
          });  
        res.send(clothes);
  });
  });
  
});
var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    
    clothes = this.response;
    
    document.getElementById("demo").innerHTML = clothes;
    
  };
  
  xhttp.open("GET", "http://localhost:3000/post", true);
  xhttp.send();
 
    