/AsynchronousBears

Filter one file by another, send requests for remaining elements

Primary LanguageJavaScript

Asynchronous Bears

Language: JS+Node

I don’t think I can go any longer without properly understanding Asynchronous JavaScript.

In a nutshell, performing any action that takes longer than running a line of code (loading a file, sending a request, database lookups) cause the results to lag behind the code that is running. So you’ll see things like values printing as undefined because they haven’t gotten the information back in time.

This project loads two text files, filters one by the other, and then sends a request to wikipedia to get some overview text for each valid entry.

The tough part is returning all of those descriptions in the original order, in a common object.

Most of the code I wrote was based on this this video, though I decided to load text from wikipedia instead of images, so I could keep it a console app.