I understand an array of objects to be an array with objects in it and when it is logged to the console, it looks like the below. I can tell that the const iceCreams = [{type:'cup', flavor:'chocoloate'},{type:'cone', flavor:'vanilla'},{type:'cup', flavor:'strawberry'},{type:'conse', flavor:'mint'}]
I was recently on a project and so something similar but instead of the index (0,1,2, etc.), there were a combination of numbers and letters which represented the id. It looked something like this in the console.
Is this still an array of objects? If so, why is the index not a number? How is this represented in JavaScript code?
CodePudding user response:
From the information provided in the question, this seems like a collection of Objects. This could be a bit deceiving when you first look at it. But it is not an array it is a collection of Objects where the key is a string (or number or both combined) and the value is also an object.
Please go through the following example I created and you may see something similar printed as in the picture.
Make sure to copy the code into the browser console and run it or better if you could create a code snippet in the browser source section so you could clearly inspect it. PLEASE NOTE Running this code in StackOverflow itself looks different
let demoObject = { "abc":
{
"ADMISSION_ID" : 1632881,
"ADDITIONAL_DATA" : null,
"CREATED_BY" : "7348500",
"CREATED_DATE" : "2022-09-29T03:27:06Z",
"HOSPITAL" : 105,
"HOSPITAL_GROUP_ID" : 58,
"HOSPITAL_ID" : 105,
"IS_ACTIVE" : null,
"IS_DELETED" : 0,
"LOCATION" : null,
"MODIFIED_BY" : "1",
"MODIFIED_DATE" : "2022-10-02T09:35:59Z",
"ROW_VERSION" : 4,
"TENANT_ID" : 58,
"ADMISSION_NUMBER" : "A20229291626839",
"ADMISSION_REASON" : "NON_SURGICAL",
"ADMISSION_REQUEST_NO" : 1649632,
"ADMISSION_STATUS" : "DISCHARGED",
"ADMISSION_TYPE" : "Routine",
"ADMITTED_BY_USER_ID" : null,
"ADMITTED_BY_USER_NAME" : "Abdullah Ali Mohammed MANSOUR",
"ADMITTED_DATE" : "2022-09-29T03:27:06Z",
"ADMITTING_DOCTOR_ID" : 7245,
"ADMITTING_DOCTOR_NAME" : "وليد نقر",
"APPOINTMENT_ID" : null,
"AUTOMATIC_CONSENT_TAKEN" : 0,
"BED_CODE" : "ER-OBS F",
"BED_LOCATION" : "Cluster S2 \/ Damad General Hospital \/ Damad General Hospital \/ Ground Floor \/ ER \/ ER-OBS F",
"BED_NO" : 3376,
"BED_RESERVATION_ID" : 1031741,
"CLINIC_GROUP_ID" : null,
"CLINIC_ID" : 35376,
"CLINIC_NAME" : "تخصص العيون فرز",
"COMPANION_ID" : null,
"COMPANION_NAME" : null,
"COMPANY_APPROVAL_NO" : null,
"CURRENT_BED_NO" : 3376,
"CURRENT_LOCATION" : "Cluster S2 \/ Damad General Hospital \/ Damad General Hospital \/ Ground Floor \/ ER \/ ER-OBS F",
"CUSTOM_DATA" : "null",
"DIRECT_ADMISSION" : null,
"DIRECT_ADMISSION_TYPE" : null,
"ER_ADMISSION_ID" : null,
"EXPECTED_DISCHARGE_DATE" : "2022-09-29T21:00:00Z",
"IS_ACTIVE_ADMISSION" : 0,
"IS_AMBULANCE_REQUIRED" : null,
"IS_FROM_ER" : 0,
"IS_IN_WAITING_LIST" : null,
"IS_NEW_BORN" : 0,
"IS_OUT_ON_PASS" : 0,
"IS_PATIENT_CONSENT_TAKEN" : 1,
"IS_PATIENT_IN_ICU" : 0,
"IS_PATIENT_PREGNANT" : null,
"IS_RELATIVE_AVAILABLE" : 0,
"IS_RELATIVE_ID_TAKEN" : null,
"IS_TENTATIVE" : 0,
"IS_WRISTBAND_PRINTED" : null,
"LOUNGE_BED_CODE" : null,
"LOUNGE_BED_LOCATION" : null,
"LOUNGE_BED_NO" : null,
"LOUNGE_BED_RESERVATION_ID" : null,
"MULTIPLE_PREGNANCY_TYPE" : null,
"MULTIPLE_PREGNANCY_TYPE_ID" : null,
"NATIONALITY" : null,
"NATIONALITY_ID" : null,
"NO_OF_WEEKS_PREGNANT" : null,
"NURSING_GROUP_ID" : 3,
"NURSING_GROUP_NAME" : "قسم تنويم النساء",
"PATIENT_GENDER" : 2,
"PATIENT_ID" : 533325,
"PATIENT_ID_OF_MOTHER" : null,
"PATIENT_NAME" : "namisah ali MUSAAD aljawhariu",
"PATIENT_POMR_ID" : 1791742,
"PAY_TYPE" : null,
"PREGNANCY_TYPE" : null,
"PREGNANCY_TYPE_ID" : null,
"REFERRAL_DOCTOR_ID" : 7245,
"REFERRAL_DOCTOR_NAME" : "وليد نقر",
"REFERRING_CLINIC_ID" : 35376,
"RELATIVE_ID_NUMBER" : null,
"REMARKS" : null,
"ROOM_TYPE_ID" : 104,
"ROOM_TYPE_NAME" : "Normal Room",
"TENTATIVE_ROOM_ID" : null,
"TENTATIVE_ROOM_NAME" : null,
"DISCHARGE_ID" : 1633548,
"ROOM_CATEGORY_ID" : 104,
"ROOM_ID" : 833,
"ADMITTING_DIAGNOSIS" : "H26.4 After-cataract",
"FORENSIC_COMMITTEE_APPROVAL_STATUS" : null
},
"def": {
"ADMISSION_ID" : 1632790,
"ADDITIONAL_DATA" : null,
"CREATED_BY" : "7348500",
"CREATED_DATE" : "2022-09-29T02:38:04Z",
"HOSPITAL" : 105,
"HOSPITAL_GROUP_ID" : 58,
"HOSPITAL_ID" : 105,
"IS_ACTIVE" : null,
"IS_DELETED" : 0,
"LOCATION" : null,
"MODIFIED_BY" : "3615065",
"MODIFIED_DATE" : "2022-09-29T03:14:04Z",
"ROW_VERSION" : 2,
"TENANT_ID" : 58,
"ADMISSION_NUMBER" : "A20229291626748",
"ADMISSION_REASON" : null,
"ADMISSION_REQUEST_NO" : 1649556,
"ADMISSION_STATUS" : "DISCHARGED",
"ADMISSION_TYPE" : null,
"ADMITTED_BY_USER_ID" : null,
"ADMITTED_BY_USER_NAME" : null,
"ADMITTED_DATE" : "2022-09-29T02:38:03Z",
"ADMITTING_DOCTOR_ID" : null,
"ADMITTING_DOCTOR_NAME" : null,
"APPOINTMENT_ID" : null,
"AUTOMATIC_CONSENT_TAKEN" : null,
"BED_CODE" : null,
"BED_LOCATION" : null,
"BED_NO" : null,
"BED_RESERVATION_ID" : null,
"CLINIC_GROUP_ID" : null,
"CLINIC_ID" : 35357,
"CLINIC_NAME" : "Emergency Department",
"COMPANION_ID" : null,
"COMPANION_NAME" : null,
"COMPANY_APPROVAL_NO" : null,
"CURRENT_BED_NO" : null,
"CURRENT_LOCATION" : null,
"CUSTOM_DATA" : "null",
"DIRECT_ADMISSION" : null,
"DIRECT_ADMISSION_TYPE" : null,
"ER_ADMISSION_ID" : null,
"EXPECTED_DISCHARGE_DATE" : null,
"IS_ACTIVE_ADMISSION" : 0,
"IS_AMBULANCE_REQUIRED" : null,
"IS_FROM_ER" : 1,
"IS_IN_WAITING_LIST" : 0,
"IS_NEW_BORN" : null,
"IS_OUT_ON_PASS" : null,
"IS_PATIENT_CONSENT_TAKEN" : null,
"IS_PATIENT_IN_ICU" : null,
"IS_PATIENT_PREGNANT" : 0,
"IS_RELATIVE_AVAILABLE" : null,
"IS_RELATIVE_ID_TAKEN" : null,
"IS_TENTATIVE" : null,
"IS_WRISTBAND_PRINTED" : null,
"LOUNGE_BED_CODE" : null,
"LOUNGE_BED_LOCATION" : null,
"LOUNGE_BED_NO" : null,
"LOUNGE_BED_RESERVATION_ID" : null,
"MULTIPLE_PREGNANCY_TYPE" : null,
"MULTIPLE_PREGNANCY_TYPE_ID" : null,
"NATIONALITY" : null,
"NATIONALITY_ID" : null,
"NO_OF_WEEKS_PREGNANT" : null,
"NURSING_GROUP_ID" : 1,
"NURSING_GROUP_NAME" : "EMERGENCY CLINIC GROUP",
"PATIENT_GENDER" : null,
"PATIENT_ID" : 533325,
"PATIENT_ID_OF_MOTHER" : null,
"PATIENT_NAME" : "namisah ali MUSAAD aljawhariu",
"PATIENT_POMR_ID" : 2137407,
"PAY_TYPE" : null,
"PREGNANCY_TYPE" : null,
"PREGNANCY_TYPE_ID" : null,
"REFERRAL_DOCTOR_ID" : null,
"REFERRAL_DOCTOR_NAME" : null,
"REFERRING_CLINIC_ID" : null,
"RELATIVE_ID_NUMBER" : null,
"REMARKS" : null,
"ROOM_TYPE_ID" : null,
"ROOM_TYPE_NAME" : null,
"TENTATIVE_ROOM_ID" : null,
"TENTATIVE_ROOM_NAME" : null,
"DISCHARGE_ID" : 1621865,
"ROOM_CATEGORY_ID" : null,
"ROOM_ID" : null,
"ADMITTING_DIAGNOSIS" : null,
"FORENSIC_COMMITTEE_APPROVAL_STATUS" : null
},
"ijk":{
"ADMISSION_ID" : 1619783,
"ADDITIONAL_DATA" : null,
"CREATED_BY" : "7346831",
"CREATED_DATE" : "2022-09-25T02:45:04Z",
"HOSPITAL" : 105,
"HOSPITAL_GROUP_ID" : 58,
"HOSPITAL_ID" : 105,
"IS_ACTIVE" : null,
"IS_DELETED" : 0,
"LOCATION" : null,
"MODIFIED_BY" : "1",
"MODIFIED_DATE" : "2022-09-25T07:10:13Z",
"ROW_VERSION" : 4,
"TENANT_ID" : 58,
"ADMISSION_NUMBER" : "A20229251613739",
"ADMISSION_REASON" : "NON_SURGICAL",
"ADMISSION_REQUEST_NO" : 1636387,
"ADMISSION_STATUS" : "DISCHARGED",
"ADMISSION_TYPE" : "Routine",
"ADMITTED_BY_USER_ID" : null,
"ADMITTED_BY_USER_NAME" : "Soltan Ahmed Sholn",
"ADMITTED_DATE" : "2022-09-25T02:45:04Z",
"ADMITTING_DOCTOR_ID" : 7245,
"ADMITTING_DOCTOR_NAME" : "وليد نقر",
"APPOINTMENT_ID" : null,
"AUTOMATIC_CONSENT_TAKEN" : 0,
"BED_CODE" : "NICU-8",
"BED_LOCATION" : "Cluster S2 \/ Damad General Hospital \/ Damad General Hospital \/ Ground Floor \/ NICU \/ NICU-8",
"BED_NO" : 3366,
"BED_RESERVATION_ID" : 1015055,
"CLINIC_GROUP_ID" : null,
"CLINIC_ID" : 35376,
"CLINIC_NAME" : "تخصص العيون فرز",
"COMPANION_ID" : null,
"COMPANION_NAME" : null,
"COMPANY_APPROVAL_NO" : null,
"CURRENT_BED_NO" : 3366,
"CURRENT_LOCATION" : "Cluster S2 \/ Damad General Hospital \/ Damad General Hospital \/ Ground Floor \/ NICU \/ NICU-8",
"CUSTOM_DATA" : "null",
"DIRECT_ADMISSION" : null,
"DIRECT_ADMISSION_TYPE" : null,
"ER_ADMISSION_ID" : null,
"EXPECTED_DISCHARGE_DATE" : "2022-09-25T21:00:00Z",
"IS_ACTIVE_ADMISSION" : 0,
"IS_AMBULANCE_REQUIRED" : null,
"IS_FROM_ER" : 0,
"IS_IN_WAITING_LIST" : null,
"IS_NEW_BORN" : 0,
"IS_OUT_ON_PASS" : 0,
"IS_PATIENT_CONSENT_TAKEN" : 1,
"IS_PATIENT_IN_ICU" : 0,
"IS_PATIENT_PREGNANT" : null,
"IS_RELATIVE_AVAILABLE" : 0,
"IS_RELATIVE_ID_TAKEN" : null,
"IS_TENTATIVE" : 0,
"IS_WRISTBAND_PRINTED" : null,
"LOUNGE_BED_CODE" : null,
"LOUNGE_BED_LOCATION" : null,
"LOUNGE_BED_NO" : null,
"LOUNGE_BED_RESERVATION_ID" : null,
"MULTIPLE_PREGNANCY_TYPE" : null,
"MULTIPLE_PREGNANCY_TYPE_ID" : null,
"NATIONALITY" : null,
"NATIONALITY_ID" : null,
"NO_OF_WEEKS_PREGNANT" : null,
"NURSING_GROUP_ID" : 3,
"NURSING_GROUP_NAME" : "قسم تنويم النساء",
"PATIENT_GENDER" : 2,
"PATIENT_ID" : 533325,
"PATIENT_ID_OF_MOTHER" : null,
"PATIENT_NAME" : "namisah ali MUSAAD aljawhariu",
"PATIENT_POMR_ID" : 1791742,
"PAY_TYPE" : null,
"PREGNANCY_TYPE" : null,
"PREGNANCY_TYPE_ID" : null,
"REFERRAL_DOCTOR_ID" : 7245,
"REFERRAL_DOCTOR_NAME" : "وليد نقر",
"REFERRING_CLINIC_ID" : 35376,
"RELATIVE_ID_NUMBER" : null,
"REMARKS" : null,
"ROOM_TYPE_ID" : 103,
"ROOM_TYPE_NAME" : "DEFAULT",
"TENTATIVE_ROOM_ID" : null,
"TENTATIVE_ROOM_NAME" : null,
"DISCHARGE_ID" : 1609313,
"ROOM_CATEGORY_ID" : 103,
"ROOM_ID" : 832,
"ADMITTING_DIAGNOSIS" : "H25.0 Senile incipient cataract",
"FORENSIC_COMMITTEE_APPROVAL_STATUS" : null
},
"lmn":{
"ADMISSION_ID" : 1319034,
"ADDITIONAL_DATA" : null,
"CREATED_BY" : "150443",
"CREATED_DATE" : "2022-06-26T13:26:16Z",
"HOSPITAL" : 101,
"HOSPITAL_GROUP_ID" : 58,
"HOSPITAL_ID" : 101,
"IS_ACTIVE" : null,
"IS_DELETED" : 0,
"LOCATION" : null,
"MODIFIED_BY" : null,
"MODIFIED_DATE" : "2022-06-26T14:12:37Z",
"ROW_VERSION" : 3,
"TENANT_ID" : 58,
"ADMISSION_NUMBER" : "A20226261312352",
"ADMISSION_REASON" : null,
"ADMISSION_REQUEST_NO" : 1334137,
"ADMISSION_STATUS" : "DISCHARGED",
"ADMISSION_TYPE" : null,
"ADMITTED_BY_USER_ID" : null,
"ADMITTED_BY_USER_NAME" : null,
"ADMITTED_DATE" : "2022-06-26T13:26:15Z",
"ADMITTING_DOCTOR_ID" : 5234,
"ADMITTING_DOCTOR_NAME" : "ALI JIBRIN",
"APPOINTMENT_ID" : null,
"AUTOMATIC_CONSENT_TAKEN" : null,
"BED_CODE" : null,
"BED_LOCATION" : null,
"BED_NO" : null,
"BED_RESERVATION_ID" : null,
"CLINIC_GROUP_ID" : null,
"CLINIC_ID" : 35357,
"CLINIC_NAME" : "Emergency Department",
"COMPANION_ID" : null,
"COMPANION_NAME" : null,
"COMPANY_APPROVAL_NO" : null,
"CURRENT_BED_NO" : null,
"CURRENT_LOCATION" : null,
"CUSTOM_DATA" : "null",
"DIRECT_ADMISSION" : null,
"DIRECT_ADMISSION_TYPE" : null,
"ER_ADMISSION_ID" : null,
"EXPECTED_DISCHARGE_DATE" : null,
"IS_ACTIVE_ADMISSION" : 0,
"IS_AMBULANCE_REQUIRED" : null,
"IS_FROM_ER" : 1,
"IS_IN_WAITING_LIST" : 0,
"IS_NEW_BORN" : null,
"IS_OUT_ON_PASS" : null,
"IS_PATIENT_CONSENT_TAKEN" : null,
"IS_PATIENT_IN_ICU" : null,
"IS_PATIENT_PREGNANT" : 0,
"IS_RELATIVE_AVAILABLE" : null,
"IS_RELATIVE_ID_TAKEN" : null,
"IS_TENTATIVE" : null,
"IS_WRISTBAND_PRINTED" : null,
"LOUNGE_BED_CODE" : null,
"LOUNGE_BED_LOCATION" : null,
"LOUNGE_BED_NO" : null,
"LOUNGE_BED_RESERVATION_ID" : null,
"MULTIPLE_PREGNANCY_TYPE" : null,
"MULTIPLE_PREGNANCY_TYPE_ID" : null,
"NATIONALITY" : null,
"NATIONALITY_ID" : null,
"NO_OF_WEEKS_PREGNANT" : null,
"NURSING_GROUP_ID" : 1,
"NURSING_GROUP_NAME" : "EMERGENCY CLINIC GROUP",
"PATIENT_GENDER" : null,
"PATIENT_ID" : 533325,
"PATIENT_ID_OF_MOTHER" : null,
"PATIENT_NAME" : "namisah ali MUSAAD aljawhariu",
"PATIENT_POMR_ID" : 1710194,
"PAY_TYPE" : null,
"PREGNANCY_TYPE" : null,
"PREGNANCY_TYPE_ID" : null,
"REFERRAL_DOCTOR_ID" : null,
"REFERRAL_DOCTOR_NAME" : null,
"REFERRING_CLINIC_ID" : null,
"RELATIVE_ID_NUMBER" : null,
"REMARKS" : null,
"ROOM_TYPE_ID" : null,
"ROOM_TYPE_NAME" : null,
"TENTATIVE_ROOM_ID" : null,
"TENTATIVE_ROOM_NAME" : null,
"DISCHARGE_ID" : 1295097,
"ROOM_CATEGORY_ID" : null,
"ROOM_ID" : null,
"ADMITTING_DIAGNOSIS" : null,
"FORENSIC_COMMITTEE_APPROVAL_STATUS" : null
},
"opq":{
"ADMISSION_ID" : 677215,
"ADDITIONAL_DATA" : null,
"CREATED_BY" : "1069144143",
"CREATED_DATE" : "2021-12-11T15:50:26Z",
"HOSPITAL" : 101,
"HOSPITAL_GROUP_ID" : 58,
"HOSPITAL_ID" : 101,
"IS_ACTIVE" : null,
"IS_DELETED" : 0,
"LOCATION" : null,
"MODIFIED_BY" : null,
"MODIFIED_DATE" : "2022-01-04T11:32:59Z",
"ROW_VERSION" : 3,
"TENANT_ID" : 58,
"ADMISSION_NUMBER" : "A20211211670311",
"ADMISSION_REASON" : null,
"ADMISSION_REQUEST_NO" : 681889,
"ADMISSION_STATUS" : "DISCHARGED",
"ADMISSION_TYPE" : null,
"ADMITTED_BY_USER_ID" : null,
"ADMITTED_BY_USER_NAME" : null,
"ADMITTED_DATE" : "2021-12-11T15:50:26Z",
"ADMITTING_DOCTOR_ID" : 5229,
"ADMITTING_DOCTOR_NAME" : "AMAL ALI",
"APPOINTMENT_ID" : null,
"AUTOMATIC_CONSENT_TAKEN" : null,
"BED_CODE" : null,
"BED_LOCATION" : null,
"BED_NO" : null,
"BED_RESERVATION_ID" : null,
"CLINIC_GROUP_ID" : null,
"CLINIC_ID" : 35357,
"CLINIC_NAME" : "Emergency Department",
"COMPANION_ID" : null,
"COMPANION_NAME" : null,
"COMPANY_APPROVAL_NO" : null,
"CURRENT_BED_NO" : null,
"CURRENT_LOCATION" : null,
"CUSTOM_DATA" : "null",
"DIRECT_ADMISSION" : null,
"DIRECT_ADMISSION_TYPE" : null,
"ER_ADMISSION_ID" : null,
"EXPECTED_DISCHARGE_DATE" : null,
"IS_ACTIVE_ADMISSION" : 0,
"IS_AMBULANCE_REQUIRED" : null,
"IS_FROM_ER" : 1,
"IS_IN_WAITING_LIST" : 0,
"IS_NEW_BORN" : null,
"IS_OUT_ON_PASS" : null,
"IS_PATIENT_CONSENT_TAKEN" : null,
"IS_PATIENT_IN_ICU" : null,
"IS_PATIENT_PREGNANT" : 0,
"IS_RELATIVE_AVAILABLE" : null,
"IS_RELATIVE_ID_TAKEN" : null,
"IS_TENTATIVE" : null,
"IS_WRISTBAND_PRINTED" : null,
"LOUNGE_BED_CODE" : null,
"LOUNGE_BED_LOCATION" : null,
"LOUNGE_BED_NO" : null,
"LOUNGE_BED_RESERVATION_ID" : null,
"MULTIPLE_PREGNANCY_TYPE" : null,
"MULTIPLE_PREGNANCY_TYPE_ID" : null,
"NATIONALITY" : null,
"NATIONALITY_ID" : null,
"NO_OF_WEEKS_PREGNANT" : null,
"NURSING_GROUP_ID" : 1,
"NURSING_GROUP_NAME" : "EMERGENCY CLINIC GROUP",
"PATIENT_GENDER" : null,
"PATIENT_ID" : 533325,
"PATIENT_ID_OF_MOTHER" : null,
"PATIENT_NAME" : "namisah ali MUSAAD aljawhariu",
"PATIENT_POMR_ID" : 846859,
"PAY_TYPE" : null,
"PREGNANCY_TYPE" : null,
"PREGNANCY_TYPE_ID" : null,
"REFERRAL_DOCTOR_ID" : null,
"REFERRAL_DOCTOR_NAME" : null,
"REFERRING_CLINIC_ID" : null,
"RELATIVE_ID_NUMBER" : null,
"REMARKS" : null,
"ROOM_TYPE_ID" : null,
"ROOM_TYPE_NAME" : null,
"TENTATIVE_ROOM_ID" : null,
"TENTATIVE_ROOM_NAME" : null,
"DISCHARGE_ID" : 712310,
"ROOM_CATEGORY_ID" : null,
"ROOM_ID" : null,
"ADMITTING_DIAGNOSIS" : null,
"FORENSIC_COMMITTEE_APPROVAL_STATUS" : null
},
"rst":{
"ADMISSION_ID" : 677040,
"ADDITIONAL_DATA" : null,
"CREATED_BY" : "7333953",
"CREATED_DATE" : "2021-12-11T14:52:53Z",
"HOSPITAL" : 105,
"HOSPITAL_GROUP_ID" : 58,
"HOSPITAL_ID" : 105,
"IS_ACTIVE" : null,
"IS_DELETED" : 0,
"LOCATION" : null,
"MODIFIED_BY" : null,
"MODIFIED_DATE" : "2021-12-13T23:43:08Z",
"ROW_VERSION" : 2,
"TENANT_ID" : 58,
"ADMISSION_NUMBER" : "A20211211670136",
"ADMISSION_REASON" : null,
"ADMISSION_REQUEST_NO" : 681686,
"ADMISSION_STATUS" : "DISCHARGED",
"ADMISSION_TYPE" : null,
"ADMITTED_BY_USER_ID" : null,
"ADMITTED_BY_USER_NAME" : null,
"ADMITTED_DATE" : "2021-12-11T14:52:53Z",
"ADMITTING_DOCTOR_ID" : null,
"ADMITTING_DOCTOR_NAME" : null,
"APPOINTMENT_ID" : null,
"AUTOMATIC_CONSENT_TAKEN" : null,
"BED_CODE" : null,
"BED_LOCATION" : null,
"BED_NO" : null,
"BED_RESERVATION_ID" : null,
"CLINIC_GROUP_ID" : null,
"CLINIC_ID" : 35357,
"CLINIC_NAME" : "Emergency Department",
"COMPANION_ID" : null,
"COMPANION_NAME" : null,
"COMPANY_APPROVAL_NO" : null,
"CURRENT_BED_NO" : null,
"CURRENT_LOCATION" : null,
"CUSTOM_DATA" : "null",
"DIRECT_ADMISSION" : null,
"DIRECT_ADMISSION_TYPE" : null,
"ER_ADMISSION_ID" : null,
"EXPECTED_DISCHARGE_DATE" : null,
"IS_ACTIVE_ADMISSION" : 0,
"IS_AMBULANCE_REQUIRED" : null,
"IS_FROM_ER" : 1,
"IS_IN_WAITING_LIST" : 0,
"IS_NEW_BORN" : null,
"IS_OUT_ON_PASS" : null,
"IS_PATIENT_CONSENT_TAKEN" : null,
"IS_PATIENT_IN_ICU" : null,
"IS_PATIENT_PREGNANT" : 0,
"IS_RELATIVE_AVAILABLE" : null,
"IS_RELATIVE_ID_TAKEN" : null,
"IS_TENTATIVE" : null,
"IS_WRISTBAND_PRINTED" : null,
"LOUNGE_BED_CODE" : null,
"LOUNGE_BED_LOCATION" : null,
"LOUNGE_BED_NO" : null,
"LOUNGE_BED_RESERVATION_ID" : null,
"MULTIPLE_PREGNANCY_TYPE" : null,
"MULTIPLE_PREGNANCY_TYPE_ID" : null,
"NATIONALITY" : null,
"NATIONALITY_ID" : null,
"NO_OF_WEEKS_PREGNANT" : null,
"NURSING_GROUP_ID" : 1,
"NURSING_GROUP_NAME" : "EMERGENCY CLINIC GROUP",
"PATIENT_GENDER" : null,
"PATIENT_ID" : 533325,
"PATIENT_ID_OF_MOTHER" : null,
"PATIENT_NAME" : "namisah ali MUSAAD aljawhariu",
"PATIENT_POMR_ID" : 846666,
"PAY_TYPE" : null,
"PREGNANCY_TYPE" : null,
"PREGNANCY_TYPE_ID" : null,
"REFERRAL_DOCTOR_ID" : null,
"REFERRAL_DOCTOR_NAME" : null,
"REFERRING_CLINIC_ID" : null,
"RELATIVE_ID_NUMBER" : null,
"REMARKS" : null,
"ROOM_TYPE_ID" : null,
"ROOM_TYPE_NAME" : null,
"TENTATIVE_ROOM_ID" : null,
"TENTATIVE_ROOM_NAME" : null,
"DISCHARGE_ID" : 652379,
"ROOM_CATEGORY_ID" : null,
"ROOM_ID" : null,
"ADMITTING_DIAGNOSIS" : null,
"FORENSIC_COMMITTEE_APPROVAL_STATUS" : null
}}
console.log(demoObject);
CodePudding user response:
Look at Proxy is not an array : example : In this example I have an object inside of this object I have multiples objects each object has a key.
const proxy = {
obj_1: {id: 1},
obj_2: {id: 2}
obj_3: {id: 3}
obj_4: {id: 4}
obj_5: {id: 5}
}
But in the first One you've an array inside of this array we have multiple objects there is a difference, the object is not iterator you can't looping over objects, but array is iterator.
example :
// array store multiple objects
const array = [{...},{...},{...},{...},{...}];