Write a JavaScript program that will do the following:
- Create an array of size 50.
- Store randomly generated number (between 0 and 10) into thisarray.
- Ask users what number they want to search in the array. Makesure user given number is between 0 and 10.
- Search the user given number in the array:
- If the program found the number in the array then display allthe indexes where the number was found.
- If the program does not find the number in the array then givean appropriate message e.g. “number not found!”
- Write a function to solve this problem.
Solution
Dear Student ,
As per the requirement submitted above ,
OR
OR