2024-10-05 the idiocy of this code const randInt = () => Math.floor(Math.random() * 1_000_000); Array.from({ length: 10_000_000 }, randInt); { length: 10 } is a object literal expression, it create a object with a single propert, of string type, "length". in Array.from(arg), the arg can be array-like object or iterable object. { length: 10 } is array-like obj, technically. it is missing int-like string keys, e.g. "0". still, technically, it's a array like object. array-like obj means, Array.isArray(obj) returns false. and it has string keys of "0", "1", etc, consecutive. plus a string key "length". so, Array.from({ length: 10 }), will take the arry-like thing { length: 10 } into a real array. meaning, Array.isArray(obj) on it is true. Array.from(arg, f), just apply f to the result. so, gorg's code, entail all of the above. now more. in const randInt = () => Math.floor(Math.random() * 1_000_000); Array.from({ length: 10_000_000 }, randInt); note the randInt is applied to the elements. but randInt takes no arg. now, if you want to create a array of random int, lots other more logical ways, even shorter in syntax. this is why, i find georg's code eye-sore. it is, the antithesis, of logical clarity. now that remindes me georg's insistence to omit html ending tags. lol. yeah, same philosophy. # HHHH--------------------------------------------------- another way to say why i find this code so ill Array.from({ length: 10_000_000 }, randInt); is that, there so many equally effficient way or terse code, why must you entail all the js warts? your code, often invoke all the js warts. # HHHH--------------------------------------------------- this would be most elegant ```JavaScript const xx = Array(10).fill(0).map(() => Math.floor(Math.random() * 1_000_000)); console.log(xx); ``` when u access object propert or array, using the syntax x[3], that 3, is auto turned into a string. so, x[3] is same as x["3"]