함수 정의문에서 arguments을 사용하면 매개변수를 사용하는 것처럼 함수 호출문의 값을 받아올 수 있습니다.
function 함수명(){ arguments; }함수명(데이터1, 데이터2 ...) //함수호출
function 함수명(){ arguments; }
함수명(데이터1, 데이터2 ...) //함수호출
function sum(){ let sum = arguments[0] + arguments[1] +arguments[2]; document.write(sum); }; sum(100,200,300); //600
Last updated 4 years ago
Was this helpful?