
Array.of() 메소드는 전달된 모든 인자를 새로운 배열에 포함합니다.
undefined를 포함한 새로운 배열을 반환합니다.
Array.of() 메소드의 동작에 대한 문서는 MDN 웹 문서에서 확인할 수 있습니다.
예제를 통해 확인해 보겠습니다.
#hostingforum.kr
javascript
console.log(Array.of(1, 2, 3)); // [1, 2, 3]
console.log(Array.of(1, 2, undefined)); // [1, 2, undefined]
console.log(Array.of(1, 2, null)); // [1, 2, null]
Array.of() 메소드는 전달된 모든 인자를 새로운 배열에 포함합니다. undefined를 포함한 새로운 배열을 반환합니다.
2025-07-08 11:58