Functional Scope


#1

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

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

myApartment();

<while defining a function we write:

function myApartment()
{
}

<This is the code I have written :

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

function myApartment()

{
  
  var mailBoxNumber='Box 3';
  
  laundryRoom= 'In-unit';
  

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

}
  
myApartment();

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

```

Replace this line with your code.

<do not remove the three backticks above>

#2

What issue are you having?


#3

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