Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1. What is different Between const, let, var
  2. 2. What is closure
  3. 3. In what order will this code execute:
  4. console.log('1');
  5. setTimeout(function() {
  6.     console.log('2');
  7. })
  8. console.log('3');
  9. setTimeout(function() {
  10. console.log('4')
  11. }, 200);
  12.  
  13. 4. What will happen if we execute this code:
  14. var food = 'Hamburger';
  15. var food = 'Pizza'
  16. let city = 'Boston'
  17. let city = 'San Diego'
  18. console.log(food);
  19. console.log(city);
  20.  
  21. 5. What is IIFE Functions?
  22.  
  23. 6. What will this print:
  24. var obj = {
  25.     city: 'Sarajevo',
  26.   getCity:() => {
  27.     console.log(this.city)
  28.   }
  29. }
  30.  
  31. obj.getCity();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement