문제
Write a function argumentsLength that returns the count of arguments passed to it.
https://leetcode.com/problems/return-length-of-arguments-passed/
예시
코드
/**
* @param {...(null|boolean|number|string|Array|Object)} args
* @return {number}
*/
var argumentsLength = function(...args) {
return args.length;
};
/**
* argumentsLength(1, 2, 3); // 3
*/
인자의 개수를 리턴하면 된다.
728x90
'Algorithm > leetcode' 카테고리의 다른 글
[leetcode][JS] 2723. Add Two Promises (0) | 2024.02.06 |
---|---|
[leetcode][JS] 2704. To Be Or Not To Be (0) | 2024.02.02 |
[leetcode][JS] 2695. Array Wrapper (0) | 2024.01.31 |
[leetcode][JS] 2677. Chunk Array (0) | 2024.01.30 |
[leetcode][JS] 2667. Create Hello World Function (0) | 2024.01.29 |