if ((() => {
let hasChrome = false;
let hasBrowser = false;
try {
hasChrome = (typeof chrome === 'object' && chrome !== null && typeof chrome.runtime !== 'undefined');
} catch (e) {
// NOP
}
try {
hasBrowser = (typeof browser === 'object' && browser !== null && typeof browser.runtime !== 'undefined');
} catch (e) {
// NOP
}
return (hasBrowser && !hasChrome);
})()) {
chrome = browser;
}
The code above seems an arrow function,but I wonder where is the name of the function? How to understand it?
Shouldn't arrow function like this?hello = () => { return "Hello World!"; }
Any assistance is highly appreciated and thanks in advance.