SHARE
TWEET

a

a guest Mar 21st, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1. Fix the code below to ensure that the index is properly displayed in every iteration with 200ms delay:
  2.  
  3.  
  4.  
  5. (function() {  
  6. var index,  
  7. length = 20;  
  8. for (index = 0; index < this.length; index++) {  
  9. setTimeout(function() {  
  10. console.log(index);  
  11. }, 200);  
  12. }  
  13. })();
  14.  
  15.  
  16.  
  17. 2. Fix the code below to print alerts only in IE7;
  18.  
  19.  
  20.  
  21. (function() {  
  22. alert("Hello World");  
  23. })();
  24.  
  25.  
  26.  
  27. 4. Fix the code below to enable verification of the function (single-statement):
  28.  
  29.  
  30.  
  31. var object = {
  32. alert : function(txt){
  33. alert(txt);
  34. },
  35. confirm : function(txt){
  36. confirm(txt);
  37. }
  38. }
  39.  
  40. object.alert("Warning: you are about to delete this item!");
  41. object.confirm("Are you sure?");
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top