Any help and explanation for this topic("object constructor") & question will be highly appreciated. Thank you in advance!
Bob was hired as an airport information officer and needs to generate status messages for each flight†Letâs help him! Complete the given program by fixing the constructor, making a flight object, and assign it to given variable to correctly execute the corresponding message. Flight ID and the flight status(landed, on time, delayed, etc.) are taken as input. \\my poor code function main() { //take flight number and its status var flightNumber = readLine(); var flightStatus = readLine(); } function flight(flightNumber, flightStatus) { //fix the constructor this.flightNumber = flightNumber; this.flightStatus = flightStatus; } var flight1 = new flight(flightNumber,flightStatus); console.log('The flight ' + flight1.flightNumber + ' is ' + flight1.flightStatus)