Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. // function DelayedGreeter(name) {
  2. // this.name = name;
  3. // }
  4.  
  5. // DelayedGreeter.prototype.greet = function() {
  6. // setTimeout(() => {
  7. // console.log('Hello ' + this.name);
  8. // }, 500);
  9. // };
  10.  
  11. // const greeter = new DelayedGreeter('World');
  12. // greeter.greet();
  13.  
  14. // function Person(name, surname, age) {
  15. // this.name = name;
  16. // this.surname = surname;
  17. // this.age = age;
  18. // }
  19.  
  20. // Person.prototype.getFullName = function() {
  21. // return this.name + ' ' + this.surname;
  22. // };
  23.  
  24. // Person.older = function(person1, person2) {
  25. // return (person1.age >= person2.age) ? person1: person2;
  26. // }
  27.  
  28. // class Person {
  29. // constructor(name, surname, age) {
  30. // this.name = name;
  31. // this.surname = surname;
  32. // this.age = age;
  33. // }
  34.  
  35. // getFullName() {
  36. // return this.name + '' + this.surname;
  37. // }
  38.  
  39. // static older(person1, person2) {
  40. // return (person1.age >= person2.age) ? person1: person2;
  41. // }
  42.  
  43. // }
  44.  
  45. // class PersonWithMiddlename extends Person {
  46. // constructor(name, middlename, surname, age) {
  47. // super(name, surname, age);
  48. // this.middlename = middlename;
  49. // }
  50.  
  51. // getFullName() {
  52. // return this.name + ' ' + this.middlename + ' ' + this.surname;
  53. // }
  54. // }
  55.  
  56. // const x = 22;
  57. // const y = 17;
  58. // const obj = {x, y};
  59.  
  60. // module.exports = {
  61. // square(x) {
  62. // return x * x;
  63. // },
  64. // cube(x) {
  65. // return x * x * x;
  66. // }
  67. // };
  68.  
  69. // const namespace = '-webkit-';
  70. // const style = {
  71. // [namespace + 'box-sizing']: 'border-box',
  72. // [namespace + 'box-shadow']: '10px10px5px #888888'
  73. // };
  74.  
  75. // const person = {
  76. // name: 'George',
  77. // surname: 'Boole',
  78.  
  79. // get fullname() {
  80. // return this.name + '' + this.surname;
  81. // },
  82.  
  83. // set fullname(fullname) {
  84. // let parts = fullname.split('');
  85. // this.name = parts[0];
  86. // this.surname = parts[1];
  87. // }
  88. // };
  89.  
  90. // console.log(person.fullname);
  91. // console.log(person.fullname = 'Alan Turing');
  92. // console.log(person.name);
  93.  
  94.  
  95. //Map and Set collections
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement