1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-12 10:51:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,6 +1,6 @@
<p>Write a function that checks if a given object 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&#39;s methods.</p>
<p>Write a function that checks if a given value&nbsp;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&#39;s methods.</p>
<p>There are&nbsp;no constraints on the data types that can be passed to the function.</p>
<p>There are&nbsp;no constraints on the data types that can be passed to the function. For example, the value or the class could be&nbsp;<code>undefined</code>.</p>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
@@ -19,7 +19,7 @@
<strong>Explanation:</strong>
class Animal {};
class Dog extends Animal {};
checkIfInstance(new Dog(), Animal); // true
checkIfInstanceOf(new Dog(), Animal); // true
Dog is a subclass of Animal. Therefore, a Dog object is an instance of both Dog and Animal.</pre>