Skip to content

Commit

Permalink
repo with tasks HowProgrammingWorks#8
Browse files Browse the repository at this point in the history
  • Loading branch information
evakononchuk committed Aug 24, 2022
1 parent 879b714 commit b712215
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Exercises/1-callback.js
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 };
4 changes: 2 additions & 2 deletions Exercises/2-closure.js
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 };

0 comments on commit b712215

Please sign in to comment.