I need to remove items from array until there is only one javascript : I have made array and all but i only need function that clears every second item from list and doing that job until there is only 1 item left for example i need something to do in array from 1-10 including 1 and 10 the result need to be 5?

Any sugestions it is similar like this but only need it for javascript not phyton
https://stackoverflow.com/questions/21869984/how-to-delete-elements-of-a-circular-list-until-there-is-only-one-element-left-u