Functional Scope exercise not working


#1



I am stuck at step 4. I got credit for steps 1-3. The last line of my code prevents the script from compiling, which is the point of completing step 4. I'm not getting credit for accomplishing the objective of step 4, even though I clearly did, and so I cannot move on to step 5.


var laundryRoom = 'Basement';
var mailRoom = 'Room 1A';

function myApartment() {
  var mailBoxNumber = 'Box 3';
  var laundryRoom = 'In-unit';
  console.log('Mail box: ' + mailBoxNumber + ', Laundry: ' + laundryRoom);
}

console.log('Laundry: ' + laundryRoom +  ', Mail: ' + mailRoom);
myApartment();
console.log(mailBoxNumber);


#2

Remove this console.log,

and call your function. :slight_smile:


#3

Removing those two lines seems to have fixed it, although I don't see why you need to remove them in order for it to work. I never would have figured that out without posting here.


#4

Because they never asked you to include a console.log outside of your function. :slight_smile:

Haha that's why we're here to help! :smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.