Learn JavaScript Scope - Lesson 2 (Functional Scope) Bug


#1

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.


#2

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


#3

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);
};

myApartment();

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


#4

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.


#5

This is what the

screen tells me.


#6

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(mailBoxNumber);
console.log('Laundry: ' + laundryRoom + ', Mail: ' + mailRoom);


#7

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


#8

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


#9

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


#10

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