Introduction to Handling Impure Functions

Get a brief introduction to handling impure functions.

The world is full of inconsistencies, and the resulting unpredictability is why we have impure functions.

Impure functions are functions that can return different values from the same input.

If we use a function that expects a number from users, what prevents them from inputting “hot dogs”? If we have a sign-in form on a website, what will prevent users from submitting the wrong password? If our program fetches data from a database, what guarantees that data is always there?

Get hands-on with 1200+ tech skills courses.