As you can read, the digitalRead functions returns HIGH or LOW: https://www.arduino.cc/reference/en/language/functions/digital-io/digitalread/.
When that is printed as a number, then LOW happens to be 0.
As you can read, the digitalRead functions returns HIGH or LOW: https://www.arduino.cc/reference/en/language/functions/digital-io/digitalread/.
When that is printed as a number, then LOW happens to be 0.