freeCodeCamp: Local Scope and Functions - doesn't work

Challenge Local Scope and Functions has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function myFunction() {
  'use strict';

   var myVar = "test";  
  console.log(myVar);
}
myFunction();

// run and check the console 
// myVar is not defined outside of myFunction
console.log(myVar);

// now remove the console log line to pass the test


href=“http://content.screencast.com/users/Pisstt/folders/Default/media/d1d59d3a-6ca0-493b-9910-3c421028f88b/2016-01-17_1925.png”>

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 26 (4 by maintainers)

Most upvoted comments

function myLocalScope() { ‘use strict’; var myVar = “teste”;

console.log(); } myLocalScope();

// Run and check the console // myVar is not defined outside of myLocalScope console.log();

// Now remove the console log line to pass the test

can confirm this is a bug. need to refresh in order to pass.

I had the same issue

Also required a refresh for this to work, did not work initially.