feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 72f7833c6c
commit a1a4eeaed7
134 changed files with 2075 additions and 0 deletions

View File

@@ -8,6 +8,30 @@ categories:
patterns:
- dfs
function_signature: "function checkIfInstanceOf(obj, classFunction)"
test_cases:
visible:
- input: { obj: "new Date()", classFunction: "Date" }
expected: true
- input: { obj: "5", classFunction: "Number" }
expected: true
- input: { obj: "Date", classFunction: "Date" }
expected: false
hidden:
- input: { obj: "null", classFunction: "Object" }
expected: false
- input: { obj: "undefined", classFunction: "Object" }
expected: false
- input: { obj: "'hello'", classFunction: "String" }
expected: true
- input: { obj: "[]", classFunction: "Array" }
expected: true
- input: { obj: "[]", classFunction: "Object" }
expected: true
- input: { obj: "{}", classFunction: "Object" }
expected: true
description: |
Write a function that checks if a given value is an instance of a given class or superclass. For this problem, an object is considered an instance of a given class if that object has access to that class's methods.