A slightly simpler way than your method is to use the Javascript in operator
alert('x' in o); // true
alert('x' in t); // false
A slightly simpler way than your method is to use the Javascript in operator
alert('x' in o); // true
alert('x' in t); // false