maybe I suggest .length == 0 since that is what it seems you are using everywhere else?