<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <script type="text/javascript" src="script.js">

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

    <pre>
      Welcome to the class roster exercise!
      For this exercise you will be making a very simple web app that contains an array of student names in a .js file.
      The website will prompt you for four possible commands: add,remove,display, and quit. This web page will prompt the user
      for one of the commands. Here is what each command should do:

      add: will then create a prompt for a student name request. Then add this name to the student to the array of student names in the .js file
      remove: will create a prompt for a student name request. Then remove this name from the roster array
      display: will print out the roster using console.log
      quit:will end the while loop of prompts.
      Watch the lecture video for an example of how it should work. Also make sure to change the script src file to your own .js file!
    </pre>


  </body>
</html>
// Code goes here

var x = 0; 
var names = []


while (x==0) {
  var q = prompt ('command: ')
  if (q=='add') {var name = prompt('name please: '); names.push(name);}
  else if (q=='display'){console.log(names)}
  else if (q=='remove') {var name = prompt('name please: '); names = names. filter(i => i != name );}
  else if (q=='quit'){alert('thanks'); x=1}
  else {x=0}

}

/* Styles go here */