The way I interpreted the original line 9 was that the innermost statement (inline if) will be evaluated first resulting in either "#id" or "id".
#id will be interpreted by jQuery to find the element with the matching ID tag of id however I'm not exactly sure what jQuery will do with the input if it's not a string. I assumed that it will have the same behaviour as the previous one so that's what I changed it to. 
Any help in clearing this up will be appreciated!