Created
May 19, 2018 17:19
-
-
Save khg0712/7612eac6cf5a05d71237e7c5216b1505 to your computer and use it in GitHub Desktop.
arguments 객체 사용 예시
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function average() { | |
var sum = 0; | |
for(var i = 0; i<arguments.length; i++) { | |
sum += arguments[i]; | |
} | |
return sum/arguments.length; | |
} | |
average(1,2,3,4,5);//3 반환 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment