0
Code will not output message.
function flight() { //take flight number and its status var flightNumber = readLine(); var flightStatus = readLine(); var flight1 = new flight(flightNumber, flightStatus); //assign a flight object to flight1 variable //output console.log('The flight ' + flight1.number + ' is ' + flight1.status) ; } function flight(flightNumber, flightStatus) { //fix the constructor flight1.number = flightNumber; flight1.status = flightStatus; };
2 Answers
0
Javascript or Node? Javascript doesn't use readLine(), Node does.
You have 2 functions named `flight`, I think the first one was meant as function `main`
The second `flight` function is a constructor, it doesn't recognize `flight1`, so you need to replace all `flight1` inside `flight` function by `this`
0
Yeah it works now appreciate it.