I found this code snippet, which checks if Safari browser is used:
var isSafari = /constructor/i.test(window.HTMLElement);
but I don't really know what's going on here. Could someone explain me how it works? I know that constructor
returns the function that created the RegExp object's prototype and i
performs case-insensitive matching, but what exactly is HTMLElement
?