How to restrict a loop to get the value -1 or less in a array loop

Code

let min = -100;
let max = 100;
var dataArr = [];
var newValue = 0;
for (let i = 0; i<151; i++) {
  newValue += Math.floor(Math.random() * (max - min + 1)) + min;
  dataArr.push(newValue);
};

I wonder how to make it so it gets restricted from getting a number under 0.
I need the range with -100, but some kind of system that prevents it to get -1 or less.

If it’s at 100 for example then -100 should work.

If that doesn’t work to make, then I need it to refresh the page or restart the for loop till it gets the correct data.

26 posts were merged into an existing topic: Arrays and Math.random(), adding new number + or - previous number

Please do not create duplicate topics for the same challenge/project question(s). This duplicate topic has been unlisted.

Thank you.