We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0867baa commit fd592e3Copy full SHA for fd592e3
JavaScript/a-calculated.js
@@ -0,0 +1,23 @@
1
+'use strict';
2
+
3
+// Usage
4
5
+const data = { name: 'Marcus Aurelius', born: 121, city: 'Rome' };
6
7
+const cities = {
8
+ 'Roman Empire': ['Rome']
9
+};
10
11
+const [obj, transaction] = Transaction.start(data, {
12
+ age() {
13
+ return (
14
+ new Date().getFullYear() -
15
+ new Date(this.born + '').getFullYear()
16
+ );
17
+ },
18
+ country() {
19
+ // implementation cann access cities index
20
+ }
21
+});
22
23
+console.dir({ age: obj.age, country: obj.country });
0 commit comments