{ "data": { "question": { "questionId": "2820", "questionFrontendId": "2703", "boundTopicId": null, "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\n\n", "translatedTitle": null, "translatedContent": null, "isPaidOnly": false, "difficulty": "Easy", "likes": 23, "dislikes": 8, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "[5]\n[{},null,\"3\"]", "categoryTitle": "JavaScript", "contributors": [], "topicTags": [], "companyTagStats": null, "codeSnippets": [ { "lang": "JavaScript", "langSlug": "javascript", "code": "/**\n * @return {number}\n */\nvar argumentsLength = function(...args) {\n \n};\n\n/**\n * argumentsLength(1, 2, 3); // 3\n */", "__typename": "CodeSnippetNode" }, { "lang": "TypeScript", "langSlug": "typescript", "code": "function argumentsLength(...args: any[]): number {\n\n};\n\n/**\n * argumentsLength(1, 2, 3); // 3\n */", "__typename": "CodeSnippetNode" } ], "stats": "{\"totalAccepted\": \"2.6K\", \"totalSubmission\": \"2.7K\", \"totalAcceptedRaw\": 2551, \"totalSubmissionRaw\": 2723, \"acRate\": \"93.7%\"}", "hints": [], "solution": null, "status": null, "sampleTestCase": "[5]", "metaData": "{\n \"name\": \"argumentsLength\",\n \"params\": [\n {\n \"type\": \"string\",\n \"name\": \"argsArr\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [], "enableRunCode": true, "enableTestMode": false, "enableDebugger": false, "envInfo": "{\"javascript\": [\"JavaScript\", \"

Node.js 16.13.2.

\\r\\n\\r\\n

Your code is run with --harmony flag, enabling new ES6 features.

\\r\\n\\r\\n

lodash.js library is included by default.

\\r\\n\\r\\n

For Priority Queue / Queue data structures, you may use 5.3.0 version of datastructures-js/priority-queue and 4.2.1 version of datastructures-js/queue.

\"], \"typescript\": [\"Typescript\", \"

TypeScript 4.5.4, Node.js 16.13.2.

\\r\\n\\r\\n

Your code is run with --harmony flag, enabling new ES2020 features.

\\r\\n\\r\\n

lodash.js library is included by default.

\"]}", "libraryUrl": null, "adminUrl": null, "challengeQuestion": null, "__typename": "QuestionNode" } } }