Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 76a5682

Browse files
Create Return Length of Arguments Passed
1 parent 0df993d commit 76a5682

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎Return Length of Arguments Passed‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Example 1:
3+
4+
Input: argsArr = [5]
5+
Output: 1
6+
Explanation:
7+
argumentsLength(5); // 1
8+
9+
One value was passed to the function so it should return 1.
10+
*/
11+
/**
12+
* @return {number}
13+
*/
14+
var argumentsLength = function(...args) {
15+
return args.length;
16+
};
17+
18+
/**
19+
* argumentsLength(1, 2, 3); // 3
20+
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /