0

Plz tell me what's wrong in this js project

Bob was hired as an airport information officer and need .. . . function main() { //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, status) { //fix the constructor this.flightNumber = flightNumber; this.status = status; };

7th Nov 2022, 8:00 AM
Sumedh Paikrao
4 Answers
+ 1
Yes, thank you sir
7th Nov 2022, 10:14 AM
Sumedh Paikrao
+ 2
Defined flightNumber. (Not Number) Use flight1.flightNumber; instead of flight1.Number; console.log('The flight ' + flight1.flightNumber + ' is ' + flight1.status );
7th Nov 2022, 8:33 AM
Jayakrishna šŸ‡®šŸ‡³
+ 1
function main() { //here taking input of flight number and status var flightNumber = readLine(); var flightStatus = readLine(); // here you are creating Object of Flight function into flight1 variable var flight1= new Flight(flightNumber, flightStatus); //output flight1 object properties in asked format console.log('The flight ' + flight1.flightNumber + ' is ' + flight1.status); } // defining function with properties "flightNumber", "status" and assigning passed values into those. function Flight(flightNumber, status) { this.flightNumber = flightNumber; this.status = status; }; //is it clears?
7th Nov 2022, 9:09 AM
Jayakrishna šŸ‡®šŸ‡³
0
Sir Plz explain me this whole code
7th Nov 2022, 8:58 AM
Sumedh Paikrao