配列のようなオブジェクトを本物の配列に変換します。
문법
Array.from(arrayLike, mapFn?)예제
아래 값을 입력하면 예제에 즉시 반영됩니다.
const→str→chars→console→doubled→const str = "hello";
const chars = Array.from(str);
console.log(chars); // ["h", "e", "l", "l", "o"]
const doubled = Array.from([1, 2, 3], (x) => x * 2);
console.log(doubled); // [2, 4, 6]