Javascript – How do I pass a document.querySelector proper as a variable?
To apply the DRY principle, I have a lot of document.querySelector in my code and I have created a function as such. const documentQuerySelector = (tag, method, message) => { document.querySelector(`.${tag}`)`.${method}`= message; }; Now when I call the function as…