This commit is contained in:
Ilya Kantor 2019-07-29 00:12:34 +03:00
parent 3ba28aa104
commit 34e9cdca36
10 changed files with 55 additions and 62 deletions

View file

@ -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
```

View file

@ -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.