daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. class Fruit{
  12.   constructor(){
  13.     this.taste = "Juicy";
  14.   }
  15.  
  16.   printSomething(){
  17.     console.log(this.taste);
  18.   }
  19. }
  20.  
  21. class Apple extends Fruit{
  22.   constructor(){
  23.     super()
  24.     this.apple = "Apple";
  25.     this.taste = "not Juicy";
  26.   }
  27.  
  28.   letMeCallPrintSomething(){
  29.     this.printSomething();
  30.   }
  31. }
  32.  
  33. boom = new Apple();
  34. boom.letMeCallPrintSomething();
  35. </script>
  36.  
  37.  
  38.  
  39. <script id="jsbin-source-javascript" type="text/javascript">class Fruit{
  40.   constructor(){
  41.     this.taste = "Juicy";
  42.   }
  43.  
  44.   printSomething(){
  45.     console.log(this.taste);
  46.   }
  47. }
  48.  
  49. class Apple extends Fruit{
  50.   constructor(){
  51.     super()
  52.     this.apple = "Apple";
  53.     this.taste = "not Juicy";
  54.   }
  55.  
  56.   letMeCallPrintSomething(){
  57.     this.printSomething();
  58.   }
  59. }
  60.  
  61. boom = new Apple();
  62. boom.letMeCallPrintSomething();</script></body>
  63. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top