October 2017
Intermediate to advanced
302 pages
7h 27m
English
The problem with JavaScript is that it often deals with asynchronous operations. These are steps that the code must complete which don't follow a linear flow in time. Normally, code runs line by line, one after the other, but what happens when we need to call an API that takes a random number of seconds to respond? We can't just stop our code and wait, and we will still have certain lines of code to execute once that call is complete, whenever that is.
The solution used to be callbacks. If we were using firebase.auth().signInWithEmailAndPassword in this manner, it would look like this:
firebase.auth().signInWithEmailAndPassword(email, password, function() { // Do something when the sign in is complete.});
We would pass ...
Read now
Unlock full access