What if I want to rewrite file mage/adminhtml/grid.js in Magento core? You may want to check it through Magento 2 Demo first.
Well, I will show you how to rewrite it with Magento 2 javascript – Magento 2.3.

1

I will create a requirejs.js file in app/code/[Namspace]/[Module_Name]/view/adminhtml/web/js/requirejs.js