mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-24 11:03:17 -04:00
fix(curriculum): step 89 hasOwnProperty fix (#55791)
Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,22 @@ Update the callback function to take `match`, `fn`, and `args` as parameters. It
|
||||
|
||||
Remember to make `fn` lower case.
|
||||
|
||||
To check if a property on a given object exists or not, you can use the <dfn>hasOwnProperty()</dfn> method.
|
||||
|
||||
The `hasOwnProperty()` method returns `true` or `false` depending on if the property is found on the object or not.
|
||||
|
||||
Here is an example of how to use the `hasOwnProperty()` method:
|
||||
|
||||
```js
|
||||
const developerObj = {
|
||||
name: 'John',
|
||||
age: 34,
|
||||
}
|
||||
|
||||
developerObj.hasOwnProperty('name'); // true
|
||||
developerObj.hasOwnProperty('salary'); // false
|
||||
```
|
||||
|
||||
# --hints--
|
||||
|
||||
Your callback function should have `match` as the first parameter.
|
||||
|
||||
Reference in New Issue
Block a user