Blog
JavaScript – Weighted Randomization
Today I worked on a project which involved weighted randomization. In other words, I had to randomly choose an item from an array of weighted items. The items that were assigned a higher weight were to be more likely to be picked. The following is a JavaScript function that accomplishes Read more…