26 lines
704 B
HTML
26 lines
704 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Countries</title>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
"use strict";
|
|
|
|
const countries = ["Argentina", "Brazil"];
|
|
while (true) {
|
|
const country = prompt("Enter the name of a country:");
|
|
if (country == null) { // if user clicks Cancel
|
|
break;
|
|
}
|
|
|
|
// if the country is already in the array, display a message that says so
|
|
// if the country isn't aleady in the array, add it to the end of the array
|
|
|
|
// if there are more than 3 element in the array, remove the first element
|
|
|
|
// display each country in the array on its own line
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |