I have created this function to check the pathname of these 3 products, but I think it looks a bit repetitive, so I'm wondering if there's a way to make it more optimised
function checkPathName() {
return (
window.location.pathname !== '/groovybaby-/241315' &&
window.location.pathname !== '/cleopatra/241162' &&
window.location.pathname !== '/cumulus/528678'
)}
checkPathName();
I'm expecting this function to return false for those pathnames