mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			787 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			787 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
请你编写一个函数 <code>argumentsLength</code>,返回传递给该函数的参数数量。
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong class="example">示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<b>输入:</b>argsArr = [5]
 | 
						||
<b>输出:</b>1
 | 
						||
<strong>解释:</strong>
 | 
						||
argumentsLength(5); // 1
 | 
						||
 | 
						||
只传递了一个值给函数,因此它应返回 1。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong class="example">示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<b>输入:</b>argsArr = [{}, null, "3"]
 | 
						||
<b>输出:</b>3
 | 
						||
<b>解释:</b>
 | 
						||
argumentsLength({}, null, "3"); // 3
 | 
						||
 | 
						||
传递了三个值给函数,因此它应返回 3。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>argsArr 是一个有效的 JSON 数组</code></li>
 | 
						||
	<li><code>0 <= argsArr.length <= 100</code></li>
 | 
						||
</ul>
 |