diff --git a/snippets/isBrowser.md b/snippets/isBrowser.md index 2145a2331..0b41b4bba 100644 --- a/snippets/isBrowser.md +++ b/snippets/isBrowser.md @@ -5,9 +5,7 @@ without throwing errors. Use `Array.includes()` on the `typeof` values of both `window` and `document` (globals usually only available in a browser environment unless they were explicitly defined), which will return `true` if one of them is `undefined`. -`typeof` allows globals to be checked for existence without throwing a ReferenceError. - -If both of them are not `undefined`, then the current environment is assumed to be a browser. +`typeof` allows globals to be checked for existence without throwing a ReferenceError. If both of them are not `undefined`, then the current environment is assumed to be a browser. ```js const isBrowser = () => ![typeof window, typeof document].includes('undefined')