I am having trouble with 'Learn Javascript-2. Functional Scope Question 5'


#1

Hi everyone
I am having trouble with the Learning Javascript No.2 Functional Scope Question 5.
Please Help...
(I got through no.4)

My Code Was...

var laundryRoom = 'Basement',mailRoom = 'Room 1A';
function myApartment(){
var mailBoxNumber = 'Box3';
laundryRoom = 'In-unit';
console.log(' Mail: ' + mailBoxNumber + ',Laundry: ' + laundryRoom );

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

Please Help
Thanks
`


#2

honestly I don't know what's really happening with this Course. I too like you am stuck.


#3

Yes me too, I am Baffled I SAY! BAFFLED!


#4

Can Anyone Help Us Please?


#5

Honestly I hope help comes soon enough :pensive:


#6

Hey, You started a day after me :slight_smile: :slight_smile:


#7

That's Nice! And Interesting!


#8

Have you gotten past that exercise :slight_smile:


#9

Read instruction once more:

Nothing showed up in the console! That's right, and it means that JavaScript does not have access to the variable, since it is hidden away in the myApartment function.

It means that you don't have access to variable mailBoxNumber because this variable exist inside the function myApartment();. So, you need delete the console.log on mailBoxNumber, and call the myApartment function instead:

console.log(mailBoxNumber); // delete this line and put:
myApartment();

#10

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