'sql table's data to array javascript

I have JavaScript code below that connect to the database and SELECT table

//Connect to database
  var sql = require("mssql");

  var config = {
  user: '****',
  password: '*****',
  server: '****',
  databse:'****',
  };
  
  sql.connect(config)
      var request = new sql.Request();
      // query to the database and get the records
      request.query("select * from Test ")

below is the terminal output.

 recordset: [
    { ID: '0      ', Name: 'Test1     ', Age: '80        ' },
    { ID: '1      ', Name: 'Test2      ', Age: '55        ' }
  ],

So I need to make array below take all data from recordset, so I can use the array in other functions

var users = [{}]

when open the page on the browser the var users should look

users = [
    { ID: '0', Name: 'Test1', Age: '80' },
    { ID: '1', Name: 'Test2', Age: '55' }
  ]


Solution 1:[1]

If you already have recordset in desired format and you want it to be users, you can do this:

var users = recordset; 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rosmak