0

I am very newbie in javascript!

I want to be professional in javscript!

I am shame to ask this question, but I cannot find anything about it :(


(faker.random.number(89999999) + 10000000)

If I am using this faker, what numbers will be generated?

And If I want to generate numbers from 10000000 to 80000000 with faker.random.number

What code will it be?

Thank you!

Sorry for very stupid qeustion.

Rich Kim
  • 11
  • 3

1 Answers1

0

You might just want to go for a native solution to this question. You can use Math, and it's functions to generate a random numbers.

function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

min and max are both inclusive.

R3FL3CT
  • 551
  • 3
  • 14