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


#1

// Global Scope!
var laundryRoom = 'Basement';
var mailRoom = 'Room 1A';

var myApartment = function() {
//Local Scope Inside the function Only!
  var mailBoxNumber = 'Box 3';
  var laundryRoom = 'In-unit';
//Print two local variables 
 console.log('Mail box: ' + mailBoxNumber + ', Laundry:' + laundryRoom);
//Print only mailBoxNumber variable
  console.log(mailBoxNumber);
};

//Instruction 4 -- this should not working globally 
console.log(mailBoxNumber);

// Function Calling
myApartment();

so where is the wrong here, why i see that error!!


#2

I'm experiencing the same issue. It's quite frustrating, I'd like to move on to the rest of the javascript lessons but nothing I do gets me past this error, including the "Get code" option.


#3

same is here bro, so is that a bug or mystery? get code just complete the various instruction which already done!


#4

Having the same problem. Used console.log and received an error. Tried to move on to the next step, calling myApartment(); and deleting console.log(mailBoxNumber); but this did not help. I have sent an bug report.


#5

O.K., now I redid the lesson and it is letting me go on. Either I mispelled something originally or it fixed itself.


#6

I had the same problem, but I tried it again and finaly found the solution.
This is the right code for instruction 4:

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

console.log(mailBoxNumber);

For instruction 5 you have to delete console.log(mailBoxNumber); and type myApartment();.

Hope this helped you!


#7

console.log("Thanks");


#8

I have no idea why the code I wrote, which was the same as yours did not work, but yours worked, so awesome ! I think this thing is flaky.


#9

where is console.log('Laundry: ' + laundryRoom + ', Mail: ' + mailRoom); from last exercise did u just delete it if yes why please help :frowning:


#10

I deleted console.log('Laundry: ' + laundryRoom + ', Mail: ' + mailRoom); because the variable "Laundry" was overwritten by the new variable inside of the function and I thought it wouldn't make any sense to log both ("Laundry: In-unit" and "Laundry: Basement").
I don't know if it's necessary to delete it. You can try to run the code with the console.log(...).


#11

they dont mention deleting the console.log from prev exercise somethin wrong with instructions or interface


#12

and running it with the console.log doesnt work


#13

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