I already checked that, didn't get the solution here is the partial code for this
this.get = function (key, defaults = null) {
var deferred = $.Deferred();
this.db.transaction(
function (transaction) {
var sql = "SELECT value FROM Options WHERE key=:key";
transaction.executeSql(sql, [key], function (transaction, results) {
deferred.resolve(results.rows.length === 1 ? results.rows.item(0) : defaults);
});
},
function (error) {
deferred.reject("Transaction Error: " + error.message);
}
);
return deferred.promise();