Select a single index in an array at random with different weights.
The weights for each item
The 0-based index of the randomly selected item
const index = SMath.selectRandomWeighted([3.5, 4, 1]); // 1 Copy
const index = SMath.selectRandomWeighted([3.5, 4, 1]); // 1
Select a single index in an array at random with different weights.