Following up on this answer for creating an array of specified length, I executed the below to get a corresponding result but filled with random numbers, instead of zeros.>
Solution from Sized array of random unique numbers
const uniqRandomNumbers = _.sampleSize(_.range(9), 4); console.log(uniqRandomNumbers);