The program is in JavaScript and must use const readline = require('readline'); 1. Create a file named dedup.js. Write a program that removes duplicates from an array. The program should be able to read an unspecified number of numbers input by the user. The user should enter a negative number when they are done entering scores. The program should remove all duplicates from the array and then iterate over the new array and display it. 2. Create a file named dedeup_2.js. Modify your dedup program and prompt the user to enter a number n. Remove all elements from the array that occur more than n times.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question

The program is in JavaScript and must use const readline = require('readline');

1. Create a file named dedup.js. Write a program that removes duplicates from an array. The program should be able to read an unspecified number of numbers input by the user. The user should enter a negative number when they are done entering scores. The program should remove all duplicates from the array and then iterate over the new array and display it.

2. Create a file named dedeup_2.js. Modify your dedup program and prompt the user to enter a number n. Remove all elements from the array that occur more than n times.

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage