-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy path2-chain.js
More file actions
22 lines (19 loc) · 327 Bytes
/
Copy path2-chain.js
File metadata and controls
22 lines (19 loc) · 327 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
const hash = () => {
const data = {};
Object.defineProperty(data, 'add', {
enumerable: false,
value(key, value) {
data[key] = value;
return data;
},
});
return data;
};
// Usage
console.dir(
hash()
.add('name', 'Marcus')
.add('city', 'Roma')
.add('born', 121),
);