The line 1 of 2-airplane.js is unnecessary. We export an anonymous object and in that line we are creating an empty object stored in the variable Airplane. The two objects have no relation. And we can store the module object in a variable named Airplane in the 2-missionControl.js file with require() and call the properties and methods in that variable Airplane.
Am I correct in saying that they should have put “Menu.” in front of each of the properties in the example? Then it would make sense and you export “Menu”. Or as stated here, don’t define an object and then subsequently export an anonymous object.
@jbevarts I agree; I was doing it and I tried to set the value of myAirplane to ‘CloudJet’ and it was wrong and then I changed it to “CloudJet” and it worked. o.O
and on the import side I always have access only to the last piece of code, I exported by this “module.exports = …” method. So just to make sure, as I understood this particular method lets us to export only one fragment of code right?