diff --git a/js/1-bad-practices/src/breaking-the-law-of-demeter.js b/js/1-bad-practices/src/breaking-the-law-of-demeter.js index bf011a6..eee52b3 100644 --- a/js/1-bad-practices/src/breaking-the-law-of-demeter.js +++ b/js/1-bad-practices/src/breaking-the-law-of-demeter.js @@ -1,11 +1,11 @@ -function isIdEven( someObject ) { - var id = someObject.getOtherObject().getId(); +function isIdEven( otherObject ) { + var id = otherObject().getId(); return ! ( id % 2 ); } function filterByEvenId( someObject ) { - if ( isIdEven( someObject ) ) { + if ( isIdEven( someObject.getOtherObject() ) ) { return someObject; }