JavaScript making conditional statements and receiving  user input