I have a problem about using the following code to check browser
view =(
typeof self !== "undefined" && self ||
typeof window !== "undefined" && window ||
this.content
);
is_safari = /constructor/i.test(view.HTMLElement) || view.safari,
is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent),
The upper code snippet is from FileSaver.js, and the problem is what is the meaning of /constructor/i.test, it seems the javascipt api not include this function. Is there anyone know about that, thanks a lot.
/pattern/
is a regular expression literali
is a flag that makes it case insensitivetest
is a method found on regular expression objectsIt is standard JavaScript.