Skip to content

Commit 119bfdf

Browse files
fix(curriculum): step 89 hasOwnProperty fix (freeCodeCamp#55791)
Co-authored-by: Jessica Wilkins <[email protected]>
1 parent 29334e4 commit 119bfdf

File tree

1 file changed

+16
-0
lines changed
  • curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet

1 file changed

+16
-0
lines changed

curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/646d4626420eeecd51f241c2.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ Update the callback function to take `match`, `fn`, and `args` as parameters. It
1111

1212
Remember to make `fn` lower case.
1313

14+
To check if a property on a given object exists or not, you can use the <dfn>hasOwnProperty()</dfn> method.
15+
16+
The `hasOwnProperty()` method returns `true` or `false` depending on if the property is found on the object or not.
17+
18+
Here is an example of how to use the `hasOwnProperty()` method:
19+
20+
```js
21+
const developerObj = {
22+
name: 'John',
23+
age: 34,
24+
}
25+
26+
developerObj.hasOwnProperty('name'); // true
27+
developerObj.hasOwnProperty('salary'); // false
28+
```
29+
1430
# --hints--
1531

1632
Your callback function should have `match` as the first parameter.

0 commit comments

Comments
 (0)