0

say I have a object like this:

 object :  {
 fuelTypes : {
      methane: 0.3,
      kerosene: 0.6,
      hydrogen: 0.2,
    }
    payloadTypes : {
      large: 0.5,
      medium: 0.6,
      small: 0.4,
    }
  }

the values after the keys are the chance of that happening, how do I implement that into a random picking function? so that the higher chance properties are picked more often

0 Answers0