0

I have sqlite forloop output comes like

[{id:1, value:'d1'}]
[{id:2, value:'d2'}]
    db.transaction(tx => {
          for (let j = 0; j < emparray.length; j++) {
            tx.executeSql(
              `SELECT * FROM database WHERE dataID =?`,
              [emparray[j].toString()],
              async (tx, res) => {
                var temp = [];
    
                for (let i = 0; i < res.rows.length; i++) {
                  temp.push(res.rows.item(i));
                }
    console.log(temp)
    
              },
            );
          }
        });

My Expected output is:

[{id:1, value:'d1'}, {id:2, value:'d2'}]

All element of array comes one array of objects

Srushti Shah
  • 810
  • 3
  • 17
anu
  • 9
  • 3

0 Answers0