28 lines
684 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>Prices</title>
</head>
<body>
<script>
"use strict";
const pricesEntry = prompt(
"Enter a list of prices separated by commas.",
"9.99,-10.99,11.99,12.99,14.99");
// split string into array
let prices = pricesEntry.split(",");
console.log(prices);
// convert prices from strings to a numbers
// delete prices less than 0
// calculate total and count of valid prices
// check count and display result
</script>
</body>
</html>