Array.from

27장 배열#Array.from 에서 보다 좀 더 자세히 정리해보았다.

구문

Array.from(arrayLike)
Array.from(arrayLike, [mapFn])
Array.from(arrayLike, [mapFn], [thisArg])

예시

Array.from({length:10},(_,index) => index+1);
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

refrence