Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. // const myName = (name, age) => {
  12. // console.log(name, age);
  13. // }
  14. // myName('Dev', 35);
  15.  
  16. class Human {
  17. constructor() {
  18. this.city = 'Sunnyvale';
  19. }
  20.  
  21. printCity() {
  22. console.log(this.city);
  23. }
  24. }
  25.  
  26.  
  27. class Person extends Human {
  28. constructor() {
  29. super();
  30. this.name = 'Dev';
  31. this.age = 30;
  32. }
  33.  
  34. printMyInfo() {
  35. console.log(this.name);
  36. console.log(this.age);
  37. }
  38. }
  39.  
  40. const person = new Person();
  41. person.printMyInfo();
  42. </script>
  43.  
  44.  
  45.  
  46. <script id="jsbin-source-javascript" type="text/javascript">// const myName = (name, age) => {
  47. // console.log(name, age);
  48. // }
  49. // myName('Dev', 35);
  50.  
  51. class Human {
  52. constructor() {
  53. this.city = 'Sunnyvale';
  54. }
  55.  
  56. printCity() {
  57. console.log(this.city);
  58. }
  59. }
  60.  
  61.  
  62. class Person extends Human {
  63. constructor() {
  64. super();
  65. this.name = 'Dev';
  66. this.age = 30;
  67. }
  68.  
  69. printMyInfo() {
  70. console.log(this.name);
  71. console.log(this.age);
  72. }
  73. }
  74.  
  75. const person = new Person();
  76. person.printMyInfo();</script></body>
  77. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement