Consider this scenario: You have a program that must fetch data, but it can only fetch this data if it is online. We might consider using an if statement to first check if we are online, and if we are, fetch the data. Here’s what that code might look like: Awesome. This code works great.
Full article