Date + days in client script

How to solve this
function calculate_payment_date(frm) {
frappe.call({
method: “frappe.client.get”,
args: {
doctype: “NG 02 Vendor Master”,
filters: {
name: frm.doc.vendor_name_database
}
},
callback: function(response) {
if(response.message) {
let vendor_master = response.message
let payment_date = new Date(frm.doc.date_of_invoice)
let credit_days = vendor_master.credit_period

        }
    }
})

}

function calculate_payment_date(frm) {
    frappe.call({
        method: "frappe.client.get",
        args: {
            doctype: "NG 02 Vendor Master",
            filters: {
                name: frm.doc.vendor_name_database,
            },
        },
        callback: function (response) {
            if (!response.message || !response.message) {
                frappe.msgprint(__("Vendor Master not found"));
                return;
            }

            const doc = response.message;

            const due_date = frappe.datetime.add_days(frm.doc.date_of_invoice, doc.credit_period);
        },
    });
}