Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const divergingData = range(9).map(i => {
let gain = random(0, 100)
let loss = 100 - gain
const highGain = random(Math.round(gain * 0.4))
const highLoss = random(Math.round(loss * 0.4))
gain = gain - highGain
loss = loss - highLoss
return {
'gained > 100$': highGain,
'gained <= 100$': gain,
'lost <= 100$': -loss,
'lost > 100$': -highLoss,
user: sets.names[i],
}
})