Check if a number is odd or even

To check if a number is odd or even:

You can also use this inside a foreach loop to identify or set classes on specific odd/even items:

Filed under: 
© 2021 - FreshLondon