677Forcing a Boolean value in Javascript aka ‘The double negative trick’

return !!someValueThatisNotBooleanButShouldBe;
I first encountered it at Mark Pilgrim’sDive Into HTML5. Anyone else remembers his classic Kant Pro Generator from the olden days?

218Obj-C, Shortcut: Boolean return value to String

Turning Boolean 1, 0 into a more descriptive description: NSLog(@”data1 is equal to data2: %@”, [data1 isEqualToData:data2] ? @”YES” : @”NO”);