Advertisement
Guest User

a

a guest
Mar 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  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?");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement