1//To genereate a number between 0-1
2Math.random();
3//To generate a number that is a whole number rounded down
4Math.floor(Math.random())
5/*To generate a number that is a whole number rounded down between
61 and 10 */
7Math.floor(Math.random() * 10) + 1 //the + 1 makes it so its not 0.
1//Write the following code to get a random number between 0 and n
2Math.floor(Math.random() * n);
1const randomVCC = () => {
2 const cc = 4728398706189983
3 const randomVirtualCreditCard = Math.random(cc).toString().replace('0.', '')
4 const visaCreditCard = 4 + randomVirtualCreditCard
5 const pattern = /\d{16}/.exec(+visaCreditCard).join('')
6 return typeof +pattern === 'number' && +pattern
7}
8console.log(randomVCC())