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:
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