So I wanted to choose an array index based off its percentage in the array.
The "percentage in the array" is just a function of the index, so like for an 11-element array the 50% index would be 5.
const numbers = [0 , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; I imagine I'd want to first go ahead by grabbing the length of the array to have a solid number to work a percentage from.
numbers.length; // 14 Though how would I then go about using a percentage to go into the array using the length to select an index that NEAREST matches the percentage? For example if I wanted to select the index that was nearest to being on 25% of the array?