You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+21-1
Original file line number
Diff line number
Diff line change
@@ -8849,7 +8849,7 @@ The execution context is created when a function is called. The function's code
8849
8849
8850
8850
**[⬆ Back to Top](#table-of-contents)**
8851
8851
8852
-
1. ### How to find the number of parameters expected by a function?
8852
+
468. ### How to find the number of parameters expected by a function?
8853
8853
The function's object has a **length** property which tells you how many formal parameters expected by a function. This is a static value defined by the function, not the number of arguments the function is called with(__arguments.length__). The basic usage of length propery is,
8854
8854
8855
8855
```javascript
@@ -8898,6 +8898,26 @@ The execution context is created when a function is called. The function's code
8898
8898
8899
8899
**[⬆ Back to Top](#table-of-contents)**
8900
8900
8901
+
469. ### What is globalThis, and what is the importance of it?
8902
+
Nowadays JavaScript language is used in a wide variety of environments and each environment has its own object model. Due to this fact, there are different ways(syntax) to access the global object.
8903
+
8904
+
1. In web browser, the global object is accessible via `window`, `self`, or `frames`.
8905
+
2. In Node environment, you have to use `global`.
8906
+
3. In Web workers, the global object is available through `self`.
8907
+
8908
+
The `globalThis` property provides a standard way of accessing the global object without writing various code snippet to support multiple environments. For example, the global object retuned from multiple environments as shown below,
0 commit comments