Can't array.push

I used so I can add table names that I want to add to my API. but when I loop through it, I can’t push the returned object to the array, but I can console.log() the returned object as an array. Here’s my code.

const contentHandler = async (req, res, db) => {
    // get the argument from get request
    const tableNames = [

    let tablekey;
    let allTable = [];, key) => {
        tablekey = `table_${key}`
        tablekey = await getData(db, table);


    res.status(200).json({data: allTable});

please remember that map returns a new array, and if you don’t use it it is a waste of resources. Maybe you want to use something else, like forEach?