Closed openam closed 4 years ago
@JB4GDI awsService === 'cloudsearch' || awsService === 'swf'
will never be true now, because let awsService = awsServiceName + ".png";
This get rid of having to have if statement by just finding the element or creating a new one.
document.querySelector("link[rel*='icon']")
will find either rel === 'icon'
or rel === 'shortut icon'
FYI I'm guessing that when you typed
awsService == 'cloudsearch' || 'swf'
you really meantawsServiceName === 'cloudsearch' || awsServiceName === 'swf'
. The|| 'swf'
would always return true as you found out. Strings are truthy, unless it's an empty string, e.g.''
.