JavaScript - Support - Detect support for background-size:cover

var cover = (function(){
  var supported = ('backgroundSize' in document.documentElement.style);
  if(supported){
    var temp = document.createElement('div');
    temp.style.backgroundSize = 'cover';
    supported = temp.style.backgroundSize == 'cover';
  };
  return supported;
})();