Today's problem is an easy one. The goal is to help everyone learn more. To do so today's problem is to share a programming trick for the language(s) of your choice. Here's an example:
In JavaScript you can coerce just about any value to an integer by attempting a bit shift.
undefined >> 0 = 0 NaN >> 0 = 0 false >> 0 = 0 true >> 0 = 1 "g" >> 0 = 0 [] >> 0 = 0 1 >> 0 = 1
Comments: