Saving a document with custom script client side

Is it possible to send a “save” command within a client side custom script? This would be equivalent of the user clicking/tapping the big purple save button in a form.

This should help -
https://frappe.io/docs/user/en/api/form#frmsave

Thanks! For hosted accounts, the client side script should be

cur_frm.save();

instead of the frm.save();

indicated in the documentation. Not sure why; is the documentation intended for server side changes in the JS files?