Hi, practicing some javascript tasks and need some help with how to use a for loop to go through an array (which has 10 integers entered by the user). The for loop is to check if there are any duplicates of numbers and then i need to remove the duplicates. The task states that the code that counts the number of occurrences should be implemented in a function.
I have no difficulty prompting the user for the 10 integers and storing them in the array. Here's the code i have
<html>
<head>
<title>UniqueNumbers</title>
</head>
<body>
<script language = "JavaScript">
//the variables
var number = new Array (10);
for (var x=0; x< number.length; x++)
number[x] = window.prompt("Please enter 10 numbers");
document.writeln("" + number);
</script>
</body>
</html>