{ "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: args = [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: args = [{}, 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": 218, "dislikes": 119, "isLiked": null, "similarQuestions": "[]", "exampleTestcases": "[5]\n[{},null,\"3\"]", "categoryTitle": "JavaScript", "contributors": [], "topicTags": [], "companyTagStats": null, "codeSnippets": [ { "lang": "JavaScript", "langSlug": "javascript", "code": "/**\n * @param {...(null|boolean|number|string|Array|Object)} args\n * @return {number}\n */\nvar argumentsLength = function(...args) {\n\t\n};\n\n/**\n * argumentsLength(1, 2, 3); // 3\n */", "__typename": "CodeSnippetNode" }, { "lang": "TypeScript", "langSlug": "typescript", "code": "type JSONValue = null | boolean | number | string | JSONValue[] | { [key: string]: JSONValue };\n\nfunction argumentsLength(...args: JSONValue[]): number {\n\t\n};\n\n/**\n * argumentsLength(1, 2, 3); // 3\n */", "__typename": "CodeSnippetNode" } ], "stats": "{\"totalAccepted\": \"63.9K\", \"totalSubmission\": \"68.7K\", \"totalAcceptedRaw\": 63912, \"totalSubmissionRaw\": 68741, \"acRate\": \"93.0%\"}", "hints": [], "solution": { "id": "1955", "canSeeDetail": false, "paidOnly": true, "hasVideoSolution": false, "paidOnlyVideo": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "[5]", "metaData": "{\n \"name\": \"argumentsLength\",\n \"params\": [\n {\n \"type\": \"string\",\n \"name\": \"args\"\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 5.1.6, Node.js 16.13.2.

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

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

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

lodash.js library is included by default.

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