Created
November 20, 2020 06:07
-
-
Save nivrith/10feb75aedaf057dd8dd0c5b49cd84b8 to your computer and use it in GitHub Desktop.
Make your own iterable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const queue = new Queue(10); | |
| queue.add(1); | |
| queue.add(2); | |
| queue.add(3); | |
| queue.add(4); | |
| for(let item of queue) { | |
| console.log(item); | |
| } | |
| // 4 | |
| // 3 | |
| // 2 | |
| // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment