{ "data": { "question": { "questionId": "2735", "questionFrontendId": "2628", "boundTopicId": null, "title": "JSON Deep Equal", "titleSlug": "json-deep-equal", "content": null, "translatedTitle": null, "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 207, "dislikes": 16, "isLiked": null, "similarQuestions": "[{\"title\": \"Convert Object to JSON String\", \"titleSlug\": \"convert-object-to-json-string\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Flatten Deeply Nested Array\", \"titleSlug\": \"flatten-deeply-nested-array\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Array of Objects to Matrix\", \"titleSlug\": \"array-of-objects-to-matrix\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Differences Between Two Objects\", \"titleSlug\": \"differences-between-two-objects\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]", "exampleTestcases": "{\"x\":1,\"y\":2}\n{\"x\":1,\"y\":2}\n{\"y\":2,\"x\":1}\n{\"x\":1,\"y\":2}\n{\"x\":null,\"L\":[1,2,3]}\n{\"x\":null,\"L\":[\"1\",\"2\",\"3\"]}\ntrue\nfalse", "categoryTitle": "JavaScript", "contributors": [], "topicTags": [], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"11.2K\", \"totalSubmission\": \"29.3K\", \"totalAcceptedRaw\": 11171, \"totalSubmissionRaw\": 29288, \"acRate\": \"38.1%\"}", "hints": [ "You can check if a value is an array with the Array.isArray() method. You can check if a value is an object by saying typeof obj === 'object' && obj !== null. You can list the keys of an object with the Object.keys() function.", "If two objects have different keys or two arrays have a different length, they cannot be equal.", "You can use recursion to investigate if the values of an object or array are also deeply equal. The base case is when the values are primitives (string, number, etc), at which case the check is a trivial === check." ], "solution": { "id": "1909", "canSeeDetail": false, "paidOnly": true, "hasVideoSolution": false, "paidOnlyVideo": true, "__typename": "ArticleNode" }, "status": null, "sampleTestCase": "{\"x\":1,\"y\":2}\n{\"x\":1,\"y\":2}", "metaData": "{\n \"name\": \"areDeeplyEqual\",\n \"params\": [\n {\n \"type\": \"string\",\n \"name\": \"o1\"\n },\n {\n \"type\": \"string\",\n \"name\": \"o2\"\n }\n ],\n \"return\": {\n \"type\": \"boolean\"\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
.
Your code is run with --harmony
flag, enabling new ES6 features.
lodash.js library is included by default.
\\r\\n\\r\\nFor 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
.
Your code is run with --harmony
flag, enabling new ES2022 features.
lodash.js library is included by default.
\"]}", "libraryUrl": null, "adminUrl": null, "challengeQuestion": null, "__typename": "QuestionNode" } } }