how do i check if i have the same object/number 2 times or more in an array ?

Use length to count the total number of items. For counting the number of each type of item, you are probably going to have to do that manually using a loop.