unable to make new dropdown based on skill

frappe.ui.form.on(“Employee Skill”, {
skill_map: function (frm) {
console.log(frm.selected_doc.skill_map);

    return frappe.call({
        method: "hrms.hr.doctype.employee_skill_map.employee_skill_map.skill_dropdown",
        args: {
            skill_category: frm.selected_doc.skill_map
        },
        callback: function (r) {
            if (r.message) {
                console.log("Retrieved Skills:", r.message);

                // Update the custom_skills field in the same child table
                let child_row = frm.selected_doc;
                
                r.message.forEach((custom_skill, index) => {
                    // Assuming custom_skills is a field in the current row
                    child_row.custom_skills = custom_skill;
                    child_row.proficiency = 1; // Example of setting proficiency
                    
                    console.log(`Updated Row ${index}:`, child_row);
                });

                // Refresh the entire child table field to reflect updates
                refresh_field("custom_skills");
            } else {
                frappe.msgprint(__('No skills found.'));
            }
        },
    });
},

});

in r.message i am getting the skills in array format i want to map the skills according to skill cateogry
r.message is giving me

  1. 0: “PHP”
  2. 1: “Python”
  3. 2: “Java”
    as output