How to override Grid Class in frappe framework?

There is a class Grid i want to override some of it’s methods but find no way to do that.

frappe/frappe/public/js/frappe/form/grid.js

I have created a page in erpnext and want to override method of Grid Class.

render_result_rows($rows, append_row) {
	let result_length = this.grid_pagination.get_result_length();
	let page_index = this.grid_pagination.page_index;
	let page_length = this.grid_pagination.page_length;
	if (!this.grid_rows) {
		return;
	}
	for (var ri = (page_index - 1) * page_length; ri < result_length; ri++) {
		var d = this.data[ri];
		if (!d) {
			return;
		}
		if (this.grid_rows[ri] && !append_row) {
			var grid_row = this.grid_rows[ri];
			grid_row.doc = d;
			grid_row.refresh();
		} else {
			var grid_row = new GridRow({
				parent: $rows,
				parent_df: this.df,
				docfields: this.docfields,
				doc: d,
				frm: this.frm,
				grid: this,
			});
			this.grid_rows[ri] = grid_row;
		}

		this.grid_rows_by_docname[d.name] = grid_row;
	}
}

Reference: Overriding a JS file - #5 by NCP

@NCP

I tried using given convention but it’s throwing error on import line

Uncaught SyntaxError: Cannot use import statement outside a module