Generate a random number between two numbers using JavaScript

New Program
const x = 1;
const y = 6;

console.log(~~(Math.random() * y) + x);

Output