2

From a short review; You should declare your variables with const or let There is a ton of copy-pasted code in there 'commission-field' is not a great name for your element, I would just call it commission Avoid writing multiple calls to document.getElementById for the same id Its hard to control what users enter, and sometimes parseFloat returns a NaN, ...


2

Sets can be used to achieve constant time lookup, however, it doesn't really makes a difference with a small number of elements. The native URL() constructor could be used to parse an URL properly and easily in JavaScript. Check browser compatibility on the bottom of the URL page on MDN. const urlsToIgnore = new Set([ 'boldchat.com', 'pinimg.com', '...


1

I feel this is not optimal or the right way of doing this. How can I make it so I don't need to each time loop over all the e.path and push to the array and than do the include. Another approach would be to use the element method matches to check if the target of the event is the element with the specific id or a child element. document.addEventListener(...


Only top voted, non community-wiki answers of a minimum length are eligible