I have this code:
const { username, password, provider } = this;
login(username, password, provider, (err) => {
this.signingIn = false;
if (err) {
this.hasError = true;
}
const { $route, $router } = this;
let redirect = '/';
if ($route.query.redirect !== undefined) {
redirect = $route.query.redirect;
}
$router.push(redirect);
this.errors = err.response.json();
var a = this.errors;
console.log(a);
//console.log(JSON.stringify(a));
});
when I see the console from the navigator, the Output is:
Promise {<resolved>: {…}}
__proto__: Promise[[PromiseStatus]]:"resolved"
[[PromiseValue]]: Objecterrors: Array(1)
0:
code:"validation.required"
detail:"password is required"
where:"request.body.password"__proto__: Objectlength: 1__proto__:
Array(0)__proto__: Object
I just receive a Promise Object, I just want get the value from 'code' or 'detail' or 'where' in a console.log()
If I try with stringify I just get two keys {}
Do you know a special method or, which is the way to get this values??