--- id: 56533eb9ac21ba0edf2244bf title: Local Scope and Functions challengeType: 1 videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert(typeof myVar === "undefined", "No global myVar variable");' - text: '' testString: 'assert(/var\s+myVar/.test(code), "Add a local myVar variable");' ```
## Challenge Seed
```js function myLocalScope() { 'use strict'; // you shouldn't need to edit this line console.log(myVar); } myLocalScope(); // Run and check the console // myVar is not defined outside of myLocalScope console.log(myVar); // Now remove the console log line to pass the test ```
### Before Test
```js var logOutput = ""; var originalConsole = console function capture() { var nativeLog = console.log; console.log = function (message) { logOutput = message; if(nativeLog.apply) { nativeLog.apply(originalConsole, arguments); } else { var nativeMsg = Array.prototype.slice.apply(arguments).join(' '); nativeLog(nativeMsg); } }; } function uncapture() { console.log = originalConsole.log; } ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```