Learn Javascript Beginner


#1



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


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

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

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

console.log(mailBoxNumber);


#2

Okay! I guess the error is pointing to the omission of the var keyword here!

  var laundryRoom = 'In-unit';

All else looks fine.


#3

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