My notes from ChatGPT: List of Cancer hospitals in India

Here is a list of some well-known cancer hospitals in India: Tata Memorial Hospital, Mumbai : One of the oldest and most reputed cancer hospitals in India, known for its comprehensive cancer care and research. All India Institute of Medical Sciences (AIIMS), New Delhi : AIIMS is a premier medical institute in India with a dedicated cancer treatment center that offers advanced care and research facilities. Adyar Cancer Institute, Chennai : Known for its expertise in cancer treatment and research, particularly in radiation oncology and surgical oncology. Rajiv Gandhi Cancer Institute and Research Centre, Delhi : A leading cancer hospital providing comprehensive cancer care with state-of-the-art facilities. Cancer Institute (WIA), Chennai : Founded by Dr. Muthulakshmi Reddy, it is one of the oldest cancer hospitals in India, known for its pioneering work in cancer treatment and research. Apollo Hospitals, Chennai : Part of the Apollo Group, it offers specialized cancer care across various...

How to find duplicates in an array in JavaScript?

Problem:

I was having a huge JSON file which contained almost 29K records and I was not sure whether or not it contains duplicates.

I want to find whether or not a JSON file contains duplicates.

Solution:

  1. I wrote a script in nodejs and used JavaScript Set which stores the unique values.
  2. Here is the script:

    const idSet = new Set();
        const hasDuplicateData = data.some((element) => {
         // for each element in test[] try to add the id to idSet
         return idSet.size === idSet.add(element.id).size;
       });
  3. Here is the github link.
Happy Coding!!!