This commit is contained in:
Ilya Kantor 2016-08-08 18:34:47 +03:00
parent d4c714cbe1
commit 03cbee39ae
89 changed files with 1579 additions and 1826 deletions

16
archive/proto/user.js Normal file
View file

@ -0,0 +1,16 @@
```js run
function User(name, birthday) {
let age = calcAge();
function calcAge() {
new Date().getFullYear() - birthday.getFullYear();
}
this.sayHi = function() {
alert(name + ', age:' + age);
};
}
let user = new User("John", new Date(2000,0,1));
user.sayHi(); // John
```