how by number (n) create an array by keys (0 till n-1) and values (0 till n-1) via javascript?

Note : i want to creating an array by number n with details -> keys : [1 ... n-1] and values : [1 ... n-1] and implementing by javascript method:

Consider:

let n=5;

// do some thing ====> my resolve ????

// let myArray = n.MyXMethod() ====> print ===> myArray : [ 0 , 1 , 2 , 3 , 4]

please help me ????