Created
December 4, 2019 11:41
-
-
Save JamieDixon/a90ebb4b65e995d0079fa56b56a31a00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hasAnyOwnProp = o => { | |
for(let p in o) { | |
return true; | |
} | |
return false | |
} | |
const a = hasAnyOwnProp({ bob: 'bob', sam: 'sam' }); | |
const b = hasAnyOwnProp({}); | |
console.log('a', a); // true | |
console.log('b', b); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment