Skip to content

Commit

Permalink
BUGFIX: setTimeout useless if you forgot the delay
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenSem committed Aug 22, 2023
1 parent 6a01794 commit f653e7f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ <h1>Math Power!</h1>
data = getFieldsData();
};

debugger;
let {num1, num2, operator} = data;

setFieldsData(num1, operator, num2); // for visual consistency if calculate({key:value})
Expand Down Expand Up @@ -153,11 +152,11 @@ <h1>Math Power!</h1>

const main = (window, setTimeout, delay) => {
// auto-calculate based on getArgsData only (silently skipped if no args passed)
window.onload = setTimeout( () => calculate(null), );
window.onload = setTimeout( () => calculate(null), delay);
};

// TODO: could modify later for Node or invisible testing to work too, idk
main(window, setTimeout, 250);
main(window, setTimeout, 100);

// };

Expand Down

0 comments on commit f653e7f

Please sign in to comment.