Gourmet_codes

test_this

Aug 20th, 2020 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // case a)
  2. this.name = 'Clint';
  3. function a() {
  4.     this.name = 'Al Pacino';
  5.     function b() {
  6.         this.name = 'Joseph';
  7.         console.log(this.name);
  8.     }
  9. }
  10. // output: Joseph
  11.  
  12. // case b)
  13. this.name = 'Clint';
  14. function a() {
  15.     this.name = 'Al Pacino';
  16.     function b() {
  17.         //this.name = 'Joseph';
  18.         console.log(this.name);
  19.     }
  20. }
  21. // output: Al Pacino
  22.  
  23. // case c)
  24. this.name = 'Clint';
  25. function a() {
  26.     // this.name = 'Al Pacino';
  27.     function b() {
  28.         // this.name = 'Joseph';
  29.         console.log(this.name);
  30.     }
  31. }
  32. // output: Clint
Add Comment
Please, Sign In to add comment