We can edit and execute JavaScript code from the *.js file in the Sources panel of Chrome DevTools. However, if the js code comes from the *.html file, how can we edit and execute them besides adding breakpoints?
In Chrome Dev Tools you can setup a 'workspace' and when you make changes to a file it will save locally and also show changes in the browser.
Please follow this Google guide on setting it up. It's easy to follow and with screenshots, if you need further help then please message back.
Link with instructions: https://developers.google.com/web/tools/setup/setup-workflow