feat(content): hidden test cases
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user