Team-Gigabyte / quotobot

Local variable name shadows variable in outer scope JS-0123
Bug risk
Minor
5 months ago3 years old
'error' is already declared in the upper scope on line 10 column 77
10        db.each("SELECT * FROM Quotes ORDER BY id DESC limit 1;", function (error, row) {
11            if (error) { console.error(error) }
12            db.run(`INSERT INTO Quotes(quote, id, source, usage) VALUES(?,?,?,?)`,
13                [qt, row.id + 1, src, 0], function (error) {14                    if (error) { console.error(error) }
15                    else { console.log("Added quote!") }
16                }