You may want to do something based on data stored in the data source or on the user’s device. To learn how to get data from a data source go here. To learn how to get data from the device go here.

In the example below, we’ve assumed you’ve retrieved some data and called it myData. The code then checks if it’s equal to ‘true’ or ‘false’.

if (myData === true) {
  // do something if data is TRUE
} else if (myData === false) {
  // do something if data is FALSE
} else {
  // do something if data is something else
}