Min/max value in child table column

Hello. Could somebody please help me with a script for finding min/max value in child table column? For example:
Max%20date
I suppose getMaxOfArray() should be used somehow…

frappe.ui.form.on('Lead', {
    log_add(frm, cdt, cdn) {
        var max = getMaxOfArray()
        frm.set_value('log_latest_date', 'max')
    },
});

First, you need to reach the child table field to check which one is the max or min
you can use this link to do that
https://docs.erpnext.com/docs/user/manual/en/customize-erpnext/custom-scripts/fetch%20value%20in%20child%20table%20field