JSFiddle - React, Tailwind, and code Playground

by David Santiago

JavaScript

const dbResult = [
  {
    slotId: 1,
    status: 'BOOKED',
    patientUserFirstName: null,
    patientUserLastName: null,
    psychologistUserFirstName: null,
    psychologistUserLastName: null,
    templateName: 'revisit',
    psychologistUserUserId: 2,
    patientUserUserId: 1
  },
  {
    slotId: 2,
    status: 'BOOKED',
    patientUserFirstName: null,
    patientUserLastName: null,
    psychologistUserFirstName: null,
    psychologistUserLastName: null,
    templateName: 'revisit',
    psychologistUserUserId: 14,
    patientUserUserId: 13
  },
  {
    slotId: 3,
    status: 'BOOKED',
    patientUserFirstName: null,
    patientUserLastName: null,
    psychologistUserFirstName: null,
    psychologistUserLastName: null,
    templateName: 'revisit',
    psychologistUserUserId: 16,
    patientUserUserId: 15
  }
];


    const topLine = Object.keys(dbResult[0]);
    


console.log(JSON.stringify(dbResult[0]));