* Check if window object exists * brackets for readability * change check to isUndefined() * isUndefined() -> !isUndefined()