JSFiddle - React, Tailwind, and code Playground

by Rishabh Sharma

JavaScript

const obj = {
  response: {
    data: {
      errors: [{
        code: 'formattype_mismatch',
        message: 'This frame belongs to the different format type',
      }, ]
    },
    status: 422
  }
}

const {
  response,
  response: {
    data: { errors }
  }
} = obj;

const [error] = errors;

console.log(response, errors, error);