Learn JavaScript Scope - Lesson 2 (Functional Scope) Bug


I am doing to Learn JavaScript lesson on scope. At Lesson 2 (Functional Scope) the lesson ask at Question 3 to put console.log(mailBoxNumber); at the end of the program. This causes an error, as intended, but the lesson does not recognize this and does not allow me to advance to the next question of placing the message in the box. So I am now completely stuck, even though I feel like I understand what the lesson is trying to teach.

This feels like a bug and I do not know what to do.


They may be an error in your code, please post your code. :slight_smile:


I am stuck at the same exercise with what I think is the same problem(bug).

My code:
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);


My answer:
Mail box: Box 3, Laundry:In-unit


I have the same problem and I have already reported the bug at the bottom of the page. I can't move on although I'm pretty sure I'm not doing anything wrong. The program works fine, but the lesson won't let me move on.


This is what the

screen tells me.


P.S Try this..it's working for me!

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

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


they gave an error in instructions to put the " console.log(mailBoxNumber); " in the last line .


Ah, I tried that...it didn't work, but thank you for your contribution anyways!!


Wow! Thanks! That actually worked for me thanks for the help :smiley:


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