Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Fix the code below to ensure that the index is properly displayed in every iteration with 200ms delay:
- (function() {
- var index,
- length = 20;
- for (index = 0; index < this.length; index++) {
- setTimeout(function() {
- console.log(index);
- }, 200);
- }
- })();
- 2. Fix the code below to print alerts only in IE7;
- (function() {
- alert("Hello World");
- })();
- 4. Fix the code below to enable verification of the function (single-statement):
- var object = {
- alert : function(txt){
- alert(txt);
- },
- confirm : function(txt){
- confirm(txt);
- }
- }
- object.alert("Warning: you are about to delete this item!");
- object.confirm("Are you sure?");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement