" In 1-missionControl.js , define a function displayAirplane() . In the function, log the value of the module and its property to the console."
Fails to clarify which property we need to log. After checking the answer it seems to be referring to the property that is present in the previous exercise, which is not explicitly stated in the instructions here.
Correct. The instructions fail to clarify what you are expecting. Frankly, console.log(Airplane) is what is described, as it does “log the value of the module and its property to the console”
I agree with this, there is not information provided in this exercise. We either need to be able to see the contents of the module (to determine the property name – this is probably the best option for fully understanding the process), or else we need to be told what the property name is.
To solve the problem, on the left of 1-missionControl.js tab you can see a small folder icon. You can browse through that and find all the javascript files listed there.
The exercise setters should definitely make the required changes. But till then we can follow this workaround.
why do I need to write “function” and the short syntax func () {} is not accepted here?
is it for the purpose of the exercice or I should always use the long version?
thanks
Whoever wrote the lesson is someone who’s stoically sticking to single quotes even though JavaScript can use either and even though the convention is to use double quotes because that’s how 90% of the other OOP languages define Strings. The tester for the lesson is specifically looking for single quotes around the filepath. Write it with single quotes (and then change it back to the sane and correct double quotes after you get the checkmark).
on the second tasks where it asked us to “define a function displayAirplane() . In the function, log the value of the module and its property to the console” and so I’ve got;
function displayAirplane() {
console.log(Airplane.specialty);
}
which throw an error at me and then I’ve looked into hints to find this
function displayAirplane() {
console.log(Airplane.myAirplane);
}
can someone tell me where does .myAirplane came from please? Cuz I’m pretty sure that’s not on the explanation…
I think you may have confused the code from given examples with the code from the exercise.
I didn’t fully realise but if you click on the folder icon in the code editor we can access the airplane.js document where we see we need to append .myAirplane to Airplane
I had the same problem. The lesson checker appears to be looking for a string exactly equal to `’./1-airplane.js’ - funny considering we were just explicitly told either way was fine…