Skip to content

Commit c88e54c

Browse files
authored
Change contact method to rest operator (#2)
* Change contact method to rest operator
1 parent 67820c1 commit c88e54c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

JavaScript/1-simple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const partial = (fn, ...args) => (...rest) => fn(...args.concat(rest));
3+
const partial = (fn, ...args) => (...rest) => fn(...args, ...rest);
44

55
const projection = (fields, obj) => Object.keys(obj)
66
.filter(field => fields.includes(field))

JavaScript/2-extended.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const partial = (fn, ...args) => (...rest) => fn(...args.concat(rest));
3+
const partial = (fn, ...args) => (...rest) => fn(...args, ...rest);
44

55
// Projection
66

0 commit comments

Comments
 (0)