From 119bfdf9b9036cf8a03700002d923d2f80f9f45e Mon Sep 17 00:00:00 2001 From: Gagan Bhullar Date: Fri, 9 Aug 2024 00:42:29 -0600 Subject: [PATCH] fix(curriculum): step 89 hasOwnProperty fix (#55791) Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> --- .../646d4626420eeecd51f241c2.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/646d4626420eeecd51f241c2.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/646d4626420eeecd51f241c2.md index 21236e19958..f01f519ea6d 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/646d4626420eeecd51f241c2.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-functional-programming-by-building-a-spreadsheet/646d4626420eeecd51f241c2.md @@ -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 hasOwnProperty() 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.