Created
January 13, 2020 14:35
-
-
Save cesarkohl/f6f17d2bfbedbde7551928e5b66ec22f to your computer and use it in GitHub Desktop.
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
| var iterator = witches [Symbol.iterator] (); | |
| var done = false; | |
| var next = iterator.next (); | |
| of { | |
| var wizard = next.value; | |
| hatSelectorMakeHouseSelection (wizard); | |
| next = iterator.next (); | |
| } while (! next.done); | |
| Assuming that the doSelectionDomain method displays on the console the student's name and their home, using our list of wizards from the previous example in this algorithm, we have as output: | |
| student: Harry Potter | House: Gryffindor | |
| student: Hermione Granger | House: Gryffindor | |
| student: Ron Weasley | House: Gryffindor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment