Whats the purpose of these lines in the script?

Hullo members,

thanks for the great support, am using this script to compute and its working well but can some one explain to me the purpose of the last 2 lines in the script. I need this for learning purposes, the lines are cur_frm.cscript.custom_invoice_amount = compute; & cur_frm.cscript.custom_total_amount_paid = compute; as shown in script below, thanks in advance.

function compute(doc, cdt, cdn){
if (doc.invoice_amount && doc.total_amount_paid){ //it checks if the fields contains a value
doc.pending_payment = doc.invoice_amount + doc.total_amount_paid * 10;
refresh_field(“pending_payment”);
}
else {
doc.pending_payment = doc.invoice_amount;
refresh_field(“pending_payment”);
}
}

cur_frm.cscript.custom_invoice_amount = compute;
cur_frm.cscript.custom_total_amount_paid = compute;

Your custom function is assigned to the custom script for execution.

Thanks for the reply, am new to programming but would like to understand, why do we add custom_ to the field name, and we add = compute. I feel understanding this script will move me a major step further in programming.

thanks in advance.