let rows = db.prepare("SELECT COUNT(*) FROM table").get();
Returns the object
{ 'COUNT(*)': 2 }
I am not sure how to read that as
console.log(rows.COUNT(*));
Returns
SyntaxError: Unexpected token *
{ 'COUNT(*)': 2 }
Since COUNT(*)
is a key. You can access it directly by using Bracket notation
console.log('No of rows ', row['COUNT(*)']); //logs 2