Skip to content

Commit

Permalink
feat: add objects solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
passerbyloo committed Jul 24, 2022
1 parent 9be8d80 commit 73d9d35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Write a function that takes an object (a) and a string (b) as argument
// Return true if the object has a property with key 'b', but only if it has a truthy value
// In other words, it should not be null or undefined or false
// Return false otherwise

function myFunction(a, b) {
return !!a[b]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ This series of challenges tests your knowledge about Javascript objects.
- [Accessing object properties one](./Javascript%20Objects/Accessing%20object%20properties%20one.js)
- [Accessing object properties three](./Javascript%20Objects/Accessing%20object%20properties%20three.js)
- [Check if property exists in object](./Javascript%20Objects/Check%20if%20property%20exists%20in%20object.js)
- [Check if property exists in object and is truthy](./Javascript%20Objects/Check%20if%20property%20exists%20in%20object%20and%20is%20truthy.js)
- [Creating Javascript objects one](./Javascript%20Objects/Creating%20Javascript%20objects%20one.js)
- [Creating Javascript objects two](./Javascript%20Objects/Creating%20Javascript%20objects%20two.js)
- [Creating Javascript objects three](./Javascript%20Objects/Creating%20Javascript%20objects%20three.js)
Expand Down

0 comments on commit 73d9d35

Please sign in to comment.