1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode/problem/return-length-of-arguments-passed.html
2023-06-02 01:00:40 +08:00

32 lines
861 B
HTML

Write a function&nbsp;<code>argumentsLength</code> that returns the count of arguments passed to it.
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> argsArr = [5]
<strong>Output:</strong> 1
<strong>Explanation:</strong>
argumentsLength(5); // 1
One value was passed to the function so it should return 1.
</pre>
<p><strong class="example">Example 2:</strong></p>
<pre>
<strong>Input:</strong> argsArr = [{}, null, &quot;3&quot;]
<strong>Output:</strong> 3
<strong>Explanation:</strong>
argumentsLength({}, null, &quot;3&quot;); // 3
Three values were passed to the function so it should return 3.
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>argsArr is a valid JSON array</code></li>
<li><code>0 &lt;= argsArr.length &lt;= 100</code></li>
</ul>