Update README.md
This commit is contained in:
parent
7f41d20c6f
commit
0f81c2cfff
|
@ -33,18 +33,6 @@ arr[3] = 5;//3__5__4
|
|||
|
||||
### observe class instance
|
||||
|
||||
```js
|
||||
obaa(obj, function (name, value , old, parents) {
|
||||
console.log("key:" + name + ", new value: " + value + ", old value: " + old + ", tree: " + parents);
|
||||
});
|
||||
var obj = [{"firstKey": "firstValue"}] ;
|
||||
obj.push({"secondKey": "secondValue"});
|
||||
obaa.set(obj[1], "changedKey", "changedValue");
|
||||
obaa.delete(obj[1], "changedKey");
|
||||
```
|
||||
|
||||
### remove prop
|
||||
|
||||
```js
|
||||
var User = function (name, age) {
|
||||
this.name = name;
|
||||
|
@ -59,6 +47,18 @@ user.name = "wangwu";//name__wangwu__lisi
|
|||
user.age = 20; //nothing output
|
||||
```
|
||||
|
||||
### remove prop
|
||||
|
||||
```js
|
||||
obaa(obj, function (name, value , old, parents) {
|
||||
console.log("key:" + name + ", new value: " + value + ", old value: " + old + ", tree: " + parents);
|
||||
});
|
||||
var obj = [{"firstKey": "firstValue"}] ;
|
||||
obj.push({"secondKey": "secondValue"});
|
||||
obaa.set(obj[1], "changedKey", "changedValue");
|
||||
obaa.delete(obj[1], "changedKey");
|
||||
```
|
||||
|
||||
## Other
|
||||
|
||||
```js
|
||||
|
|
Loading…
Reference in New Issue