Frappe.web_form.delete doesn't work

frappe.ready(function () {
	// bind events here
	frappe.web_form.delete = () => {
		frappe.confirm('Are you sure you want to delete this document?',
			function () {
				// delete document
				return true;
			function () {
				// do nothing
				return false;

Hi Shivam, @scmmishra
On web form, I would like user to confirm deletion before proceeding.
For that I have put above script in js of web form.

When user says yes, in console i do get ‘yes’ out put but deletion doesn’t happen. i.e. return true OR in other words asking JS to proceed with deletion doesn’t happen.

Please advice. Thanks!