Skip to content

Commit 6558680

Browse files
committed
Increment object value my object method
1 parent 59e206e commit 6558680

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/node
2+
const myObject = {
3+
type: 'object',
4+
value: 12
5+
};
6+
console.log(myObject);
7+
8+
myObject.incr = function () {
9+
myObject.value += 1;
10+
};
11+
12+
myObject.incr();
13+
console.log(myObject);
14+
myObject.incr();
15+
console.log(myObject);
16+
myObject.incr();
17+
console.log(myObject);

0 commit comments

Comments
 (0)