forked from HowProgrammingWorks/HigherOrderFunction
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repo with tasks HowProgrammingWorks#8
- Loading branch information
1 parent
879b714
commit b712215
Showing
2 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
const iterate = (obj, callback) => null; | ||
const iterate = (obj, callback) => { | ||
const items = Object.keys(obj); | ||
for (const key of items) { | ||
const value = obj[key]; | ||
callback(key, value, obj); | ||
} | ||
}; | ||
|
||
module.exports = { iterate }; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
const store = x => null; | ||
const store = (x) => () => x; | ||
|
||
module.exports = { store }; |