I always assumed Array.from behaves the same as Array.map for array. But it seems that for array with no initial values, they are totally different.
arr = new Array(5);
range = Array.from(arr, (v,idx) => idx); // [0,1,2,3,4]
new_arr = arr.map((v, idx) => {return idx;}); // [undefined, undefined,undefined, undefined,undefined]
So Array.from was still able to get the indices, while arr.map here just skips through all the values, actually it never calls the callback function.
How does JavaScript handles an array with no initial values?