Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // function DelayedGreeter(name) {
- // this.name = name;
- // }
- // DelayedGreeter.prototype.greet = function() {
- // setTimeout(() => {
- // console.log('Hello ' + this.name);
- // }, 500);
- // };
- // const greeter = new DelayedGreeter('World');
- // greeter.greet();
- // function Person(name, surname, age) {
- // this.name = name;
- // this.surname = surname;
- // this.age = age;
- // }
- // Person.prototype.getFullName = function() {
- // return this.name + ' ' + this.surname;
- // };
- // Person.older = function(person1, person2) {
- // return (person1.age >= person2.age) ? person1: person2;
- // }
- // class Person {
- // constructor(name, surname, age) {
- // this.name = name;
- // this.surname = surname;
- // this.age = age;
- // }
- // getFullName() {
- // return this.name + '' + this.surname;
- // }
- // static older(person1, person2) {
- // return (person1.age >= person2.age) ? person1: person2;
- // }
- // }
- // class PersonWithMiddlename extends Person {
- // constructor(name, middlename, surname, age) {
- // super(name, surname, age);
- // this.middlename = middlename;
- // }
- // getFullName() {
- // return this.name + ' ' + this.middlename + ' ' + this.surname;
- // }
- // }
- // const x = 22;
- // const y = 17;
- // const obj = {x, y};
- // module.exports = {
- // square(x) {
- // return x * x;
- // },
- // cube(x) {
- // return x * x * x;
- // }
- // };
- // const namespace = '-webkit-';
- // const style = {
- // [namespace + 'box-sizing']: 'border-box',
- // [namespace + 'box-shadow']: '10px10px5px #888888'
- // };
- // const person = {
- // name: 'George',
- // surname: 'Boole',
- // get fullname() {
- // return this.name + '' + this.surname;
- // },
- // set fullname(fullname) {
- // let parts = fullname.split('');
- // this.name = parts[0];
- // this.surname = parts[1];
- // }
- // };
- // console.log(person.fullname);
- // console.log(person.fullname = 'Alan Turing');
- // console.log(person.name);
- //Map and Set collections
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement