Skip to content

Commit c867d73

Browse files
committed
feat(totalIntegers): replace comment about best practice with reminder that typeof null is object
1 parent 3efb3f9 commit c867d73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

15_totalIntegers/solution/totalIntegers-solution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// We could define this helper function inside of totalIntegers however that would not be best practice as everytime that the recursive totalIntegers is run it would re-create the isObject function when it could just re-use it.
1+
// The extra null check is required since typeof null === "object" evaluates to true
22
const isObject = (value) => typeof value === 'object' && value !== null;
33

44
const totalIntegers = function (obj) {

0 commit comments

Comments
 (0)