2820. Return Length of Arguments Passed
My accepted JavaScript solution to LeetCode problem 2820, Return Length of Arguments Passed, running in 41ms.
- Difficulty: Easy
- JavaScript
- Runtime 41ms
- Memory 53.4MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
JavaScript
Accepted on LeetCode — runtime 41ms, memory 53.4MB, accepted 2026-01-01.
/**
* @param {...(null|boolean|number|string|Array|Object)} args
* @return {number}
*/
var argumentsLength = function(...args) {
return args.length;
};
/**
* argumentsLength(1, 2, 3); // 3
*/