{
"data": {
"question": {
"questionId": "2820",
"questionFrontendId": "2703",
"categoryTitle": "JavaScript",
"boundTopicId": 2285880,
"title": "Return Length of Arguments Passed",
"titleSlug": "return-length-of-arguments-passed",
"content": "Write a function argumentsLength
that returns the count of arguments passed to it.\n
\n
Example 1:
\n\n\nInput: argsArr = [5]\nOutput: 1\nExplanation:\nargumentsLength(5); // 1\n\nOne value was passed to the function so it should return 1.\n\n\n
Example 2:
\n\n\nInput: argsArr = [{}, null, "3"]\nOutput: 3\nExplanation: \nargumentsLength({}, null, "3"); // 3\n\nThree values were passed to the function so it should return 3.\n\n\n
\n
Constraints:
\n\nargsArr is a valid JSON array
0 <= argsArr.length <= 100
argumentsLength
,返回传递给该函数的参数数量。\n\n\n
示例 1:
\n\n\n输入:argsArr = [5]\n输出:1\n解释:\nargumentsLength(5); // 1\n\n只传递了一个值给函数,因此它应返回 1。\n\n\n
示例 2:
\n\n\n输入:argsArr = [{}, null, \"3\"]\n输出:3\n解释:\nargumentsLength({}, null, \"3\"); // 3\n\n传递了三个值给函数,因此它应返回 3。\n\n\n
\n\n
提示:
\n\nargsArr 是一个有效的 JSON 数组
0 <= argsArr.length <= 100
\\u7248\\u672c\\uff1a \\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\" TypeScript 4.5.4<\\/p>\\r\\n\\r\\n Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "[5]\n[{},null,\"3\"]",
"__typename": "QuestionNode"
}
}
}Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n
--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f \\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n