minor
This commit is contained in:
parent
3ba28aa104
commit
34e9cdca36
10 changed files with 55 additions and 62 deletions
|
@ -17,8 +17,10 @@ Here's the demo of the code:
|
|||
|
||||
```js
|
||||
let accumulator = new Accumulator(1); // initial value 1
|
||||
|
||||
accumulator.read(); // adds the user-entered value
|
||||
accumulator.read(); // adds the user-entered value
|
||||
|
||||
alert(accumulator.value); // shows the sum of these values
|
||||
```
|
||||
|
||||
|
|
|
@ -215,6 +215,8 @@ john = {
|
|||
*/
|
||||
```
|
||||
|
||||
To create complex objects, there's a more advanced syntax, [classes](info:classes), that we'll cover later.
|
||||
|
||||
## Summary
|
||||
|
||||
- Constructor functions or, briefly, constructors, are regular functions, but there's a common agreement to name them with capital letter first.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue