|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
494 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Checks if the current environment is a browser.
|
|---|
| 3 | *
|
|---|
| 4 | * This function checks for the existence of the `window.document` property,
|
|---|
| 5 | * which only exists in browser environments.
|
|---|
| 6 | *
|
|---|
| 7 | * @returns {boolean} `true` if the current environment is a browser, otherwise `false`.
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * if (isBrowser()) {
|
|---|
| 11 | * console.log("This is running in a browser");
|
|---|
| 12 | * document.getElementById('app').innerHTML = 'Hello World';
|
|---|
| 13 | * }
|
|---|
| 14 | */
|
|---|
| 15 | declare function isBrowser(): boolean;
|
|---|
| 16 |
|
|---|
| 17 | export { isBrowser };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.