Q:

JavaScript/HTML not display existing Array

So I was assigned to make a little airport information system.  I have everything running but I ran into one issue.  When i type in one the 8 listed flights besides flight 356, it gives me my alert box.  I want it to run so the user could type in all 8 of the flight numbers no problem but I can only view flight 356.  I only want the alert box to come up when I type in another flight that is not listed in my arrays.  Now, I take off the else if statement, everything runs smooth with all 8 arrays listed.  But put it back in, the issue comes up.  Here is my code.  Please let me know if something is wrong.  thanks! 
<html>
<head>
<title>KBOS Airport</title>
<script>

<!--  hide script away from browsers
function flightInfo(got) {
//obtain flight info
for (i=0; i<8; i++) {
    if (got == flightNumber[i]) break;
//problem condition below?   
else if (got ! == flightNumber[i]); alert("The flight number you have entered is invalid.  Please refresh page and try again.");  return;

}//for

    //print results
    document.write('<table border=1 align="center"><tr bgcolor=#FFFFCC><th>'+ 'Here is your flight info:<br />' + '</th>');
    document.write('<tr bgcolor=#DDDDDD><td> Airline: ' + airline[i] + '<br />' + '</tr>');
    document.write('<tr bgcolor=#DDDDDD>' + '<td>' + 'Flight Number: ' + flightNumber[i] + '<br />' + '</td>' + '</tr>');
    document.write('<tr bgcolor=#DDDDDD>' + '<td>' + 'Terminal: ' + terminal[i] + '<br />' + '</td>' + '</tr>');
    document.write('<tr bgcolor=#DDDDDD>' + '<td>' + 'Gate: ' + gate[i] + '<br />' + '</td>' + '</tr>');
    document.write('<tr bgcolor=#DDDDDD>' + '<td>' + 'Departure Time: ' + flttime[i] + "<br />" + '</td>' + '</tr>' + '</table>');
    document.write('<h1 align="center">' + 'If your flight departure time is 1/2 hr from now, please proceed to the gate.   <br/>' + '</h1>');
    document.write('<h1 align="center">' + 'Thank you for choosing our airline.   Have a safe and pleasnat trip.  <br/>' + '</h1>');
}//flightInof()

//define flight data
airline = ["Lufthansa", "Swiss Air", "USAir", "Delta Air Lines", "British Airways", "Air France", "American Airlines", "United Airlines"];
flightNumber = [356, 89, 1230, 952, 513, 910, 454, 350];
terminal = ["E", "D", "A", "C", "B", "F", "G", "H"];
gate = [5, 10, 3, 7, 1, 8, 12, 15];
flttime = ["0600AM", "0623AM", "0644AM", "0700AM", "0704AM", "0825AM", "1000AM", "1030AM"]; 

//traveler flight
input = prompt("Please, select your flight number: 356, 89, 1230, 952, 513, 910, 454 or 350", " ");
flightInfo(input);
-->

</script>
</head>
<body>
</body>

A:

Only the first one worked because it would stop on the first item and you were comparing a string(got) with a number(value in the array) using the == so it would work. 
On the others it would fall into the else if statement because of the type check (===) and you have a ; right after the condition so the alert would always be called. 
If you have to use a for loop to do it, would be better if you had a tag like hasFound, it would go like this:
function flightInfo(got) {
        let nGot = Number(got);
        let hasFound = false;
        for (i = 0; i < 8; i++) {
          if (nGot === flightNumber[i]) {
            hasFound = true;
            break;
          }
        }
        if (! hasFound) {
          alert(
            "The flight number you have entered is invalid.  Please refresh page and try again." 
          );
          return;
        }
    // ... the rest of the code

but you could use other Array methods like .findIndexOf or .includes 
another tips:
 - you should always declare variables
 - try to always use === or ! == instead of ! = or == (the diference between the two is that the first one (=== / ! ==) compares the type too while the other tries to convert it on the go)
 - ident things!