get random numbers javascript

JavaScript
Math.floor(Math.random() * 10);//Write the following code to get a random number between 0 and n
Math.floor(Math.random() * n);const randomVCC = () => {
	const cc = 4728398706189983
	const randomVirtualCreditCard = Math.random(cc).toString().replace('0.', '')
	const visaCreditCard = 4 + randomVirtualCreditCard
	const pattern = /\d{16}/.exec(+visaCreditCard).join('')
    return typeof +pattern === 'number' && +pattern
}
console.log(randomVCC())
Source

Also in JavaScript: