How do I detect whether I'm on a left- or right-hand page?

I would like to define a custom command with a conditional statement that executes a certain command if it's on a left-hand page and another if it's on a right-hand page.

The command would be executed in the page body.