Here's the 5 year-old's explanation:
Translations to adult language are written like this.
Today, you went to the beach, and you did loads of things like:
You did all of these things one after another, because you can't do multiple things at the same time.
I made a necklace off 5 of the shells you found that you can show off to your friends at school. It has one shell for each of the things you did. Then you can poit at your shells from left to right when telling your friends about the trip, so you don't foret to talk about anything you did.
You can see the thread going through the shells as the **thread of execution. One thing is being done, then the next, then the next, and so on.
After you asked your dad for an ice cream conde, you went looking for shells. You didn't just wait for him to return. And when he came back with the ice cream, he had to wait until you found your last shell before giving you the ice cream.
Even though eatIceCream() comes before findShells() in the code, it only runs at the end, when you've received the event of Daddy returning with the ice cream.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.