Posts for December, 2008

Javascript null or default operator

A neat little trick I learnt from Ting is a way to check whether a value was null or undefined using the or operator (||). It’s really simple. If valueThatMightBeEmpty has a value set, you get that value. If it is null you get the default. It’s just like the ?? operator in C#: var […]
Published in Javascript on Tuesday, December 9th, 2008