Javascript 2. Functional scope : 4

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

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

myApartment();

Error :
Did you write a console.log with the variable mailBoxNumber in it after the myApartment function?

Exercice : https://www.codecademy.com/fr/courses/learn-javascript/lessons/scope/exercises/functional-scope?action=resume

Remove this console.log and your code should work,

1 Like

thanks :slight_smile: it worked well

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