I m using the node,express,mysql2 packages .When i m using console.log(rows) ,it is giving me following output:
[{\"userid\": \"test\",\"password\": \"test\"}] <
[{"userid": "test","password": "test"}]
This is an Array of Objects. So: First loop over the array to get a single object and then extract its properties:
Array
Object
for (var i = 0; i < rows.length; i++) { var row = rows[i]; console.log(row.userid); }