myTest
with a local variable called loc
.
```js
function myTest() {
var loc = "foo";
console.log(loc);
}
myTest(); // logs "foo"
console.log(loc); // loc is not defined
```
loc
is not defined outside of the function.
myVar
variable.
testString: |
function declared(){
myVar;
}
assert.throws(declared, ReferenceError);
- text: You should add a local myVar
variable.
testString: assert(/functionmyLocalScope\(\)\{.+(var|let|const)myVar[\s\S]*}/.test(__helpers.removeWhiteSpace(code)));
```