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

批量更新数据

This commit is contained in:
2025-01-09 20:29:41 +08:00
parent 04ecea043d
commit 48cdd06c2b
5053 changed files with 156164 additions and 135322 deletions

View File

@@ -1,40 +1,40 @@
<p>请你编写一个函数,检查给定的值是否是给定类或超类的实例。</p>
<p>可以传递给函数的数据类型没有限制。例如,值或类可能是&nbsp; <code>undefined</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<b>输入:</b>func = () =&gt; checkIfInstance(new Date(), Date)
<b>输出:</b>true
<strong>解释:</strong>根据定义Date 构造函数返回的对象是 Date 的一个实例。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<b>输入:</b>func = () =&gt; { class Animal {}; class Dog extends Animal {}; return checkIfInstance(new Dog(), Animal); }
<b>输出:</b>true
<strong>解释:</strong>
class Animal {};
class Dog extends Animal {};
checkIfInstanceOf(new Dog(), Animal); // true
Dog 是 Animal 的子类。因此Dog 对象同时是 Dog 和 Animal 的实例。</pre>
<p><strong>示例 3</strong></p>
<pre>
<b>输入:</b>func = () =&gt; checkIfInstance(Date, Date)
<b>输出:</b>false
<strong>解释:</strong>日期的构造函数在逻辑上不能是其自身的实例。
</pre>
<p><strong>示例 4</strong></p>
<pre>
<b>输入:</b>func = () =&gt; checkIfInstance(5, Number)
<b>输出:</b>true
<strong>解释:</strong>5 是一个 Number。注意"instanceof" 关键字将返回 false。</pre>
<p>请你编写一个函数,检查给定的值是否是给定类或超类的实例。</p>
<p>可以传递给函数的数据类型没有限制。例如,值或类可能是&nbsp; <code>undefined</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<b>输入:</b>func = () =&gt; checkIfInstance(new Date(), Date)
<b>输出:</b>true
<strong>解释:</strong>根据定义Date 构造函数返回的对象是 Date 的一个实例。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<b>输入:</b>func = () =&gt; { class Animal {}; class Dog extends Animal {}; return checkIfInstance(new Dog(), Animal); }
<b>输出:</b>true
<strong>解释:</strong>
class Animal {};
class Dog extends Animal {};
checkIfInstanceOf(new Dog(), Animal); // true
Dog 是 Animal 的子类。因此Dog 对象同时是 Dog 和 Animal 的实例。</pre>
<p><strong>示例 3</strong></p>
<pre>
<b>输入:</b>func = () =&gt; checkIfInstance(Date, Date)
<b>输出:</b>false
<strong>解释:</strong>日期的构造函数在逻辑上不能是其自身的实例。
</pre>
<p><strong>示例 4</strong></p>
<pre>
<b>输入:</b>func = () =&gt; checkIfInstance(5, Number)
<b>输出:</b>true
<strong>解释:</strong>5 是一个 Number。注意"instanceof" 关键字将返回 false。</pre>