0

Problem displaying flight information

This program should display something like Flight NGT 929 has landed. I think there should be a variable holding the letters NGT, but I haven't had any luck so far, here's the code: function main() { //take flight number and its status var flightNumber = readLine(); var flightStatus = readLine(); var flight1 =0; //assign a flight object to flight1 variable //output console.log('The flight ' + flight1.letters + flight1.number + ' is ' + flight1.status) } function Flight(flightNumber, status, letters) { //fix the constructor number = flightNumber; status = status; flight1 = new Flight(letters); }; // ******** added to help with syntax ***** /*function person (name, age) { this.name = name; this.age = age; } var John = new person("John", 25); var James = new person("James", 21); document.write(John.age);*/

3rd Sep 2021, 4:52 PM
Natanael
1 Réponse
+ 2
You already asked this, and had got an answer. Please avoid reposting a question to help the community reduce duplicate questions. Collaborate with the contributor answering your question when you have doubts, it's better than reposting the question 👍 https://www.sololearn.com/Discuss/2873595/?ref=app
3rd Sep 2021, 5:13 PM
Ipang