I've seen many different ways of checking for available properties or methods in javascript.
if(typeof window.somePropOrMethod !== "undefined"){ }
if(window.hasOwnProperty("somePropOrMethod")){ }
if("somePropOrMethod" in window){ }
if(!!window.somePropOrMethod) { }
Which one should I use, and why? Is it all up to personal preference or are there subtle differences between them?