Question: Hello, I'm attempting to set up a function to scroll through the input array, checking for duplicates between the words that it contains on Javascript.

Hello, I'm attempting to set up a function to scroll through the input array, checking for duplicates between the words that it contains on Javascript. I am wondering, why is it not compiling?

I've set up two versions, please correct both of them and tell me why it its giving me an error.

First version:

Function duplicates (input) {

Set set = new HashSet(Arrays.asList(input));

if ( set.size()

return true;

else

return false;

}

Here is the second version: Hello, I'm attempting to set up a function to scroll through theThank you!

index.js Console Shell 1 1 2 function duplicates (input){ Set set = new HashSet(Arrays.asList(input)); /home/runner/a/index.js X Set set = new HashSet (Arrays.asList(input)); 3 4 AAAAAAAAAAAAAAA 5 6 if ( set.size()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!