Remove un-necessary word (#22)
This commit is contained in:
parent
a299169455
commit
c708e9c444
|
|
@ -811,7 +811,7 @@ Here are two ways to fix it that involves adding more brackets: `(function foo()
|
|||
|
||||
### What's the difference between a variable that is: `null`, `undefined` or undeclared? How would you go about checking for any of these states?
|
||||
|
||||
**Undeclared** variables are created when you assign to a value to an identifier that is not previously created using `var`, `let` or `const`. Undeclared variables will be defined globally, outside of the current scope. In strict mode, a `ReferenceError` will be thrown when you try to assign to an undeclared variable. Undeclared variables are bad just like how global variables are bad. Avoid them at all cost! To check for them, wrap its usage in a `try`/`catch` block.
|
||||
**Undeclared** variables are created when you assign a value to an identifier that is not previously created using `var`, `let` or `const`. Undeclared variables will be defined globally, outside of the current scope. In strict mode, a `ReferenceError` will be thrown when you try to assign to an undeclared variable. Undeclared variables are bad just like how global variables are bad. Avoid them at all cost! To check for them, wrap its usage in a `try`/`catch` block.
|
||||
|
||||
```js
|
||||
function foo() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue