작성
·
367
0
가짜배열을 진짜배열로 만들어주는 걸로 from을 배웠었는데, 여기서 사용하신 Array.prototype.slice.call이 from과 같은 역할인 건가요?
답변 3
1
1
1
"Array.prototype.slice.call"은 ES6 이전의 자바스크립트에도 사용 가능한 문법이고,
"Array.from"은 ES6부터 지원되는 것으로 알고 있습니다.
참고: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/from