Skip to content

Commit 19bdba0

Browse files
committed
Add globalThis question
2 parents b549f8e + 6e8edf6 commit 19bdba0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -8849,7 +8849,7 @@ The execution context is created when a function is called. The function's code
88498849
88508850
**[⬆ Back to Top](#table-of-contents)**
88518851
8852-
468. ### How to find the number of parameters expected by a function?
8852+
468. ### How to find the number of parameters expected by a function?
88538853
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,
88548854
88558855
```javascript
@@ -8905,18 +8905,18 @@ The execution context is created when a function is called. The function's code
89058905
2. In Node environment, you have to use `global`.
89068906
3. In Web workers, the global object is available through `self`.
89078907
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,
8909-
8910-
```javascript
8911-
//1. browser environment
8912-
console.log(globalThis); // => Window {...}
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,
8909+
8910+
```javascript
8911+
//1. browser environment
8912+
console.log(globalThis); // => Window {...}
89138913

8914-
//2. node.js environment
8915-
console.log(globalThis); // => Object [global] {...}
8914+
//2. node.js environment
8915+
console.log(globalThis); // => Object [global] {...}
89168916

8917-
//3. web worker environment
8918-
console.log(globalThis); // => DedicatedWorkerGlobalScope {...}
8919-
```
8917+
//3. web worker environment
8918+
console.log(globalThis); // => DedicatedWorkerGlobalScope {...}
8919+
```
89208920
**[⬆ Back to Top](#table-of-contents)**
89218921
89228922
<!-- QUESTIONS_END -->

0 commit comments

Comments
 (0)