Javascript – querySelector: how not to call function when return is null?
I need to execute a function on an element that may or may not exist in the DOM, using a querySelector (not querySelectorAll, because there will be at most one such element). The most elegant solution I can devise is:…