Desestructuración de la matriz en JavaScript
Tengo este código en mi aplicación vue-js:
methods: {
onSubmit() {
ApiService.post('auth/sign_in', {
email: this.email,
password: this.password,
})
.then((res) => {
saveHeaderToCookie(res.headers);
this.$router.push({ name: 'about' });
})
.catch((res) => {
this.message = res.response.data.errors[0];
this.msgStatus = true;
this.msgType = 'error';
});
},
}
Mientras ejecutaba Es-lint ... recibí un error que decía "Usar la desestructuración de matrices" (preferir-desestructuración) enthis.message = res.response.data.errors[0];
en esta línea. ¿Qué es la desestructuración de matrices y cómo hacer esto? Por favor, dame un concepto sobre esto. Lo he investigado pero no pude resolverlo