Merge remote-tracking branch 'origin/next' into next
This commit is contained in:
commit
112d6e1c26
1 changed files with 4 additions and 4 deletions
|
|
@ -65,16 +65,16 @@ todo.TodoList = Array;
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
//define a getter-setter with initial value `John`
|
//define a getter-setter with initial value `John`
|
||||||
var name = m.prop("John");
|
var a_name = m.prop("John");
|
||||||
|
|
||||||
//read the value
|
//read the value
|
||||||
var a = name(); //a == "John"
|
var a = a_name(); //a == "John"
|
||||||
|
|
||||||
//set the value to `Mary`
|
//set the value to `Mary`
|
||||||
name("Mary"); //Mary
|
a_name("Mary"); //Mary
|
||||||
|
|
||||||
//read the value
|
//read the value
|
||||||
var b = name(); //b == "Mary"
|
var b = a_name(); //b == "Mary"
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the `Todo` and `TodoList` classes we defined above are plain vanilla Javascript constructors. They can be initialized and used like this:
|
Note that the `Todo` and `TodoList` classes we defined above are plain vanilla Javascript constructors. They can be initialized and used like this:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue