Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let interval = 0;
- let direction = 0;
- setInterval(() => {
- if (direction === 0) {
- if (interval === 100) {
- direction = 1;
- return;
- }
- console.log(interval++);
- } else if (direction === 1) {
- if (interval === 0) {
- direction = 0;
- return;
- }
- console.log(interval--);
- }
- }, 50);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement