Skip to content

Commit

Permalink
Fixed instanceof summary to better match instanceof page (mdn#35062)
Browse files Browse the repository at this point in the history
* Fixed instanceof summary to better match instance of page

* Update files/en-us/web/javascript/guide/expressions_and_operators/index.md

---------

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
LostBeard and Josh-Cena authored Jul 25, 2024
1 parent 6197320 commit 4419aed
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1035,10 +1035,10 @@ The [`instanceof` operator](/en-US/docs/Web/JavaScript/Reference/Operators/insta
if the specified object is of the specified object type. The syntax is:
```js-nolint
objectName instanceof objectType
object instanceof objectType
```
where `objectName` is the name of the object to compare to `objectType`, and `objectType` is an object type, such as {{jsxref("Date")}} or {{jsxref("Array")}}.
where `object` is the object to test against `objectType`, and `objectType` is a constructor representing a type, such as {{jsxref("Date")}} or {{jsxref("Array")}}.
Use `instanceof` when you need to confirm the type of an object at runtime.
For example, when catching exceptions, you can branch to different exception-handling code depending on the type of exception thrown.
Expand Down

0 comments on commit 4419aed

Please sign in to comment.