Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var teacher = {
- name: 'Janusz',
- surname: 'Serek',
- teach: function (test) {
- return test;
- },
- getName: function () {
- return 'cześć: ' + this.name;
- }
- };
- teacher.sound = 'Hau';
- teacher.daj_glos = function () {
- return this.sound;
- };
- console.log(teacher);
- console.log(teacher.daj_glos());//odwolanie od właściwości
- // console.log(teacher.teach(64));//odwolanie od właściwości
- // ///////////////
- var Car = function (hp, type, color) {
- this.hp = hp;
- this.type = type;
- this.color = color;
- this.km = 0;
- };
- var mercedes = new Car(5050, 'W124', 'Dark Green');
- var golfMk4 = new Car(1500, 'Comfort', 'Dark Green');
- Car.prototype.drive = function (km, asqwe, ytr) {
- console.log('Jade', km, asqwe, ytr);
- };
- console.log(mercedes.drive(15));
- console.log(golfMk4.drive(15));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement